Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w $string = "/dir1/dir8/dir2"; $string =~ m|([^/]+)$|; print $1;
if i change the line of code as $string =~ m/([^/]+)$/ it doesent work.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: help in understanding a regex
by roboticus (Chancellor) on Nov 16, 2012 at 22:36 UTC | |
Re: help in understanding a regex
by 2teez (Vicar) on Nov 16, 2012 at 22:56 UTC |
Back to
Seekers of Perl Wisdom