--- Kristian Rink <[EMAIL PROTECTED]> wrote:
> basename(/tmp/whatever/file-I-would-like)
> ->file-I-would-like
> path(/tmp/whatever/file-I-would-like)
> ->/tmp/whatever
>
> Do I have those functions (or functions doing more or less the same)
> available in Perl? How are they called, where might I want start
> reading?
Hi Kris,
What you're looking for is File::Basename.
[ovid@ovid ovid]$ perl -MFile::Basename -le 'print basename("/usr/bin/perl")'
perl
[ovid@ovid ovid]$ perl -MFile::Basename -le 'print dirname("/usr/bin/perl")'
/usr/bin
Cheers,
Ovid
=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]