in reply to Use of uninitialized value when using regex
Shorter (parentheses saved and used here); arguably 'more straightforward' or 'maintainable':
my $txt="Version=2010-09-01_17-29-04 Build=26"; my ($build) = $txt =~ /(?:=)(\d+)$/; print $build;
Output: 26
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Use of uninitialized value when using regex
by JavaFan (Canon) on Sep 13, 2010 at 14:09 UTC |