in reply to Re^4: Script using File::Spec fails...
in thread Script using File::Spec fails...

What additional functionality has the second script provided?

With the second script you don't have to know what the path separator is. That is, the main thing that File::Spec provides is portability. You can use File::Spec->catfile(); and it will work on whatever platform the script is run on.

A more useful example for comparison between unix and windows would be the return value of File::Spec->devnull().

Check out the File::Spec documentation (for which you provided a link :-) for more details.

Cheers,
Rob

Replies are listed 'Best First'.
Re^6: Script using File::Spec fails...
by jdporter (Paladin) on May 26, 2007 at 17:32 UTC

    I think the point is that both scripts run effectively on both unix and windows. That means that the explicit forward slash works as a path separator on both platforms. So I think cgmd's question is valid, and not yet satisfactorily answered.

    That said, File::Spec is really about portability. It's supposed to free you from caring about such things as path separators on many platforms, such as Mac and VMS.

    A word spoken in Mind will reach its own level, in the objective world, by its own weight