in reply to Re^2: March a regex using split function
in thread March a regex using split function
But AnomalousMonk's proposal is arguably more readable.my ($f) = $s =~ m{FREE: (\d+)} or die 'no FREE';
Also, the \s* makes is possible to cope with possible variations in the number of spaces between FREE: and the value. Perhaps you don't need it if you can be absolutely sure that there will always be one and only one space there, but can you be that sure?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: March a regex using split function
by perldigious (Priest) on Sep 13, 2017 at 12:56 UTC |