for /proj/home/me/asdf.p your code would correctly give: /proj/home/me/
but for asdf1.pl the result would be: asdf1.pl
another approach:
my $temp1 = "/proj/home/me/asdf.pl"; print my_dirname($temp1) ."\n"; $temp1 = "asdf1.pl"; print my_dirname($temp1) ."\n"; $temp1 = "/asdf1.pl"; print my_dirname($temp1) ."\n"; sub my_dirname { my ($dir) = $_[0] =~ m|^(.*/)|; return $dir; }
In reply to Re^2: Data Extraction Question
by amphiplex
in thread Data Extraction Question
by EchoAngel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |