#!/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.
In reply to help in understanding a regex by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |