in reply to Regex not behaving as expected
See perldoc perlop for more info on various combinations of m//, /g and what they return in list and scalar context.use strict; my $file = 'file013.txt'; my ($sk) = $file =~ m/(\d+)/; # list context to get what () captured print $sk;
Update: Corrected typo.
|
|---|