in reply to Re^5: Cannot open a file using a relative path
in thread Cannot open a file using a relative path

It seems that i have mistaken uris as relative paths!!

Iam not quite sure i have understood the 2nd paragraph though....

If only i could use a way to try to open files with relative apths that would be very nice.
  • Comment on Re^6: Cannot open a file using a relative path

Replies are listed 'Best First'.
Re^7: Cannot open a file using a relative path
by ikegami (Patriarch) on Apr 24, 2007 at 23:20 UTC

    If only i could use a way to try to open files with relative apths that would be very nice.

    In Windows, any path that doesn't start with /, \ or d:\ (for some letter d) is a relative path

    # Relative to the current dir on the current drive open(my $fh, '<', 'file') open(my $fh, '<', './file') open(my $fh, '<', '../file') open(my $fh, '<', '../dir/file') open(my $fh, '<', 'dir/file') # Relative to the current dir on the drive c: open(my $fh, '<', 'c:file') open(my $fh, '<', 'c:./file') open(my $fh, '<', 'c:../file') open(my $fh, '<', 'c:../dir/file') open(my $fh, '<', 'c:dir/file')

    Like the commments indicate, they're not relative to DocumentRoot. Mind you, you could chdir to DocumentRoot, at which point they will effectively be relative to DocumentRoot.