in reply to Regular expression problemette
This first copies the old value of $0, the name of the current script (see perlvar), into $this_proc, and then modifies that, deleting everything up to and including the last slash.(my $this_proc = $0) =~ s:^.*/::;
BTW Your snippet will fail for filenames like "/foo.pl". To fix it, replace the first plus with a star:
$this_proc = $0 =~ /^.*\/(.+)$/ ? $1 : $0;
|
|---|