Top 3 Products & Services


Dated: Aug. 28, 2004

Related Categories

Perl Programming

Paths in Perl

Different Operating Systems use different characters as their path separator when specifying directory and file paths:

foo/bar/baz # *nix uses a /
foobarbaz # Win32 uses a
foo:bar:baz # Mac OS 9 uses a :
foo/bar/baz # Mac OS X uses a / (usually!)

In Perl you can generally just use a / as your path separator (except on Mac OS 9, thanks Hanamaki). Why? Because Perl will automagically convert the / to the correct path separator for the system it is running on! This means that coding Windows paths like this

Paths in Perl

$path = "foobarbaz";

is not required. You can just use this:

$path = "/foo/bar/baz";

and things will be fine. In fact using can be problematic, but you probably already know that :-)

  Page 1 of 2
  First | Previous | Next | Last

Now that you've gotten free know-how on this topic, try to grow your skills even faster with online video training. Then finally, put these skills to the test and make a name for yourself by offering these skills to others by becoming a freelancer. There are literally 2000+ new projects that are posted every single freakin' day, no lie!

Previous Article

Next Article

shubhangi's Comment
this article is very good
21 Sun Mar 2010
Admin's Reply:

Thanks Shubhangi.