No, they don't need to be in the same directory. Just use the full path to the file when opening it...
open my $fh, '<', '/home/tai/Documents/foo.txt'; while (my $line = <$fh>) { print "Got line: $line"; } close $fh;
In reply to Re: Correct pathway to a file
by tobyink
in thread Correct pathway to a file
by Dr Manhattan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |