in reply to Path strings

Your question isn't really related to Perl; it's more of a Unix/Linux question.

In the examples you gave:

1. /dir/dir/ 2. /dir/dir 3. dir/dir/ 4. dir/dir

Numbers 1 and 2 are absolute paths, meaning that they start at (ie. "are anchored at") the root directory "/".

Numbers 3 and 4 and relative paths, meaning that there location depends on which directory you are in when you refer to them.  For example, if you are in the absolute directory "/var/www/html", and you refer to "css/styles", you are accessing the absolute directory "/var/www/html/css/styles".

But if you started in the directory "/var/www/cgi", then referring to "css/styles" would mean an absolute path of "/var/www/cgi/css/styles" instead.

Other than that, "/dir/dir/" and "/dir/dir" are nearly always identical.  There are a few places where they behave in subtly different ways (eg. if "/dir/dir" is a symbolic link), but they are not anything you need to worry about at this stage in your learning curve.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: Path strings
by Anonymous Monk on Jan 27, 2007 at 05:25 UTC

    This was my understanding, outside of the symbolic link meaning, which I have yet to think about or delve into.

    See my other replies.