http://www.perlmonks.org?node_id=1004251

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.