Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Answer: Getting data out of a remote web page

by Juerd (Abbot)
on Feb 10, 2002 at 12:11 UTC ( #144460=note: print w/replies, xml ) Need Help??

in reply to Re: Getting data out of a remote web page
in thread Getting data out of a remote web page

foreach $link (@links) { if($link =~ /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/) { system("wget -c \"$link\""); } }

Ouch. If $link is '$(rm -rf /)1111-11-11', you're not going to like it. You should anchor the regex (/^[0-9] ... [0-9]$/) so nothing can be in front of or after your pattern. Another great thing is not having a shell parse the command line: system('wget', '-c', "$link");.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://144460]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2016-10-24 16:37 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (309 votes). Check out past polls.