Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Correct pathway to a file

by tobyink (Abbot)
on Jan 10, 2013 at 13:13 UTC ( #1012657=note: print w/ replies, xml ) Need Help??


in reply to Correct pathway to a file

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;
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Correct pathway to a file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012657]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-04-20 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls