[Petal] [BUG] $self->{base_dir} to absolute paths is not portable

William McKee william at knowmad.com
Mon Sep 22 13:10:18 BST 2003


On Mon, Sep 22, 2003 at 04:14:34PM +0100, Jean-Michel Hiver wrote:
>   $BASE_DIR = File::Spec->rel2abs ($BASE_DIR)
>      if (defined $BASE_DIR and substr ($BASE_DIR, 0, 1) ne '/');
>                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                                use File::Spec here?

There's also File::Basename which is bundled with Perl (and has been for
several versions I think).

What are you trying to check for in the code snippet? Remember, there is
also Mac to deal with which, I think, can have volume names, not just
drive names as in Win/DOS.

William

-- 
Knowmad Services Inc.
http://www.knowmad.com


More information about the Petal mailing list