When used in scalar context, the /g modifier indicates a progressive match, which makes Perl start the next match on the same variable at a position just past where the last one stopped. After a failure, the match position normally resets back to the start. Example:
Similar to various powerful modules, Perl comes with various modules for web scraping, that is extracting required information from web HTML pages. Below is a sample script that I authored to extract the movies information from www.justtollywood.com web site pages. Output:
This program is to illustrate how tools like HtmlAsText usually work.
For advanced Perl programmers, this may come handy anytime when you have to generate a hash with a dynamic naming convention for temporary processing purposes.