Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"


by root (Scribe)
on Dec 23, 1999 at 00:51 UTC ( #1208=perlfunc: print w/replies, xml ) Need Help??


See the current Perl documentation for File::Spec.

Here is our local, out-dated (pre-5.6) version:

File::Spec - portably perform operations on file names

use File::Spec;


which returns 'a/b/c' under Unix.

This module is designed to support operations commonly performed on file specifications (usually called ``file names'', but not to be confused with the contents of a file, or Perl's file handles), such as concatenating several directory and file names into a single path, or determining whether a path is rooted. It is based on code directly taken from MakeMaker 5.17, code written by Andreas König, Andy Dougherty, Charles Bailey, Ilya Zakharevich, Paul Schinder, and others.

Since these functions are different for most operating systems, each set of OS specific routines is available in a separate module, including:


The module appropriate for the current OS is automatically loaded by File::Spec. Since some modules (like VMS) make use of OS specific facilities, it may not be possible to load all modules under all operating systems.

Since File::Spec is object oriented, subroutines should not called directly, as in:

but rather as class methods:


For a reference of available functions, pleaes consult Spec_Unix, which contains the entire set, and inherited by the modules for other platforms. For further information, please see Spec::Mac, Spec::OS2, Spec::Win32, or Spec::VMS.


File::Spec::Unix, File::Spec::Mac, File::Spec::OS2, File::Spec::Win32, File::Spec::VMS, ExtUtils::MakeMaker


Kenneth Albanowski <>, Andy Dougherty <>, Andreas König <A.Koenig@franz.ww.TU-Berlin.DE>, Tim Bunce <>. VMS support by Charles Bailey <>. OS/2 support by Ilya Zakharevich <>. Mac support by Paul Schinder <>.

Log In?

What's my password?
Create A New User
erix stops reading as recommended by the blog itself
[erix]: my attention being jealously guarded ;)
[shmem]: erix, yes, it's a WTF. Since...
[erix]: antisemitic && (pro-)russian. Makes sense :P
[shmem]: erix: what's antisemitic in there? Tell me.
[erix]: AngloZionist
[shmem]: and it is *not* pro-russian. It describes the western world.
[erix]: I'm not going to read it so I could be mistaken but it reeks of useful idiocy
[shmem]: AngloZionist is not an antisemitic term.
[shmem]: erix: be assured that we all are horribly mistaken, always. What would we write tests for, if not for that fact?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-03-19 20:55 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.