Use the File::Basename module:
use strict; use File::Basename; while (<DATA>) { chomp; my $dir = dirname $_; my $file = basename $_; print "I am '$file' in '$dir'.\n"; }; __DATA__ /proj/home/me/asdf.pl asdf1.pl foo/asdf.pl
Another alternative might be the FindBin module:
use strict; use FindBin; print "I am in '$FindBin::Bin'.";
In reply to Re: Data Extraction Question
by Corion
in thread Data Extraction Question
by EchoAngel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |