http://www.perlmonks.org?node_id=1041261


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!