Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Remote Directory listing

by aitap (Curate)
on Jul 08, 2012 at 10:38 UTC ( [id://980569]=note: print w/replies, xml ) Need Help??


in reply to Re: Remote Directory listing
in thread Remote Directory listing

Yes, it's possible to match a regex against these strings. Your code can be optimized like this:
open(FILE, "<filelist.txt"); @file = <FILE>; chomp @file; close FILE; open (MYFILE, '>links.txt'); for my $i (1..10) { print MYFILE "$file[-$i]"; print "$1\n" if $file[-$i] =~ m/(\d{8}_\d{4})/; } close (MYFILE);
Sorry if my advice was wrong.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found