Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: handling files using regular expression

by ww (Bishop)
on Jun 28, 2013 at 13:58 UTC ( #1041261=note: print w/ replies, xml ) Need Help??


in reply to handling files using regular expression

What the heck does " the first occurrence of all the continuous digits" mean?

That aside, your attempt to capture the digits won't work as is; you need something like:

if ( $_ =~ m/:(\d+)/ ) { my $name = $1; print OFILE "$name\n"; }

And, of couse, it would be a good idea to close the OFILE as well as your input... and to heed -- as mentioned before -- the advice your last SOPW elicited.

Downvoted this node.

If you didn't program your executable by toggling in binary, it wasn't really programming!


Comment on Re: handling files using regular expression
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-28 15:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (257 votes), past polls