One, it works. What's your question? "Will it work" or "How to do it better?"
Two, here's some ideas on the latter. Don't hardwire anything else about the string which may have different values. Don't escape junk that needs no escaping. Don't fix the length if you might need longer or shorter matches.
print $1,$/ if $line =~ m/ ' (\d+) ' \) /x;
--
[ e d @ h a l l e y . c c ]
In reply to Re: Fetching a number
by halley
in thread Fetching a number
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |