in reply to Portable method for ignoring psuedo-files/psuedo-dirs?

Look at File::Spec's no_upwards(). There's an also updir(), but I don't see something like this_dir().

Update: Oh yeah, curdir()!

Replies are listed 'Best First'.
Re: Re: Portable method for ignoring psuedo-files/psuedo-dirs?
by Prior Nacre V (Hermit) on Mar 06, 2004 at 15:55 UTC

    There's a curdir() which will do what you want.

    My test code:

    use File::Spec; my $f = 'File::Spec'; print $f->curdir, "\n"; print $f->updir, "\n";

    My output:

    $ perl ./test_file_spec . .. $

    There's also some notes on this in the perlport manpage ("Files and Filesystems" section).

    PN5

Re: Re: Portable method for ignoring psuedo-files/psuedo-dirs?
by etcshadow (Priest) on Mar 07, 2004 at 04:17 UTC
    Thanks, no_upwards is exactly what I was looking for. I don't know how I missed it, considering that I looked through File::Spec several times, and am using it already for the other file-system-portable functions.

    Anyway, thanks.

    ------------ :Wq Not an editor command: Wq