That doesn't catch cases when the regular expression doesn't match and hence $1 might have a value assigned to it from a previous successful capturing regular expression match.
I humbly suggest either:
orprint {$pro_list} $1, "\n" if $artist_link->url() =~ /(\d{9})/;
if ($artist_link->url() =~ /(\d{9})/) { print {$pro_list} $1, "\n"; }
The curly braces around {$pro_list} disambiguates its use as the filehandle that is printed to.
In reply to Re^4: Page Scraping
by shigetsu
in thread Page Scraping
by 80degreez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |