Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re (3): opening new file in different directory

by George_Sherston (Vicar)
on Oct 23, 2001 at 19:37 UTC ( [id://120817]=note: print w/replies, xml ) Need Help??


in reply to Re (3): opening new file in different directory
in thread opening new file in different directory

So wd you recommend, say, having a function that "sandwiches" each file operation between a pair of chdirs? I do quite a lot of reading and writing, but I also pick up a lot of files (templates and so on). At the moment I keep all the auxiliary files in the same dir as the script and refer to them by name only, no explicit path.

/me scratches head and wonders whether I shd use explicit file paths for *everything* I refer to from my script. Wd that be considered good practice?

§ George Sherston

Replies are listed 'Best First'.
Re (5): opening new file in different directory
by VSarkiss (Monsignor) on Oct 23, 2001 at 19:53 UTC

    Ah, I'll give you the best answer ever in computing:

    It depends.

    Explicit paths for everything in your program sounds like overkill, since you have to maintain the paths and may end up with big headaches if you ever move stuff around.

    Personally, I'd organize the files so I wouldn't have to do a lot of chdir'ing. Then set the path once and go about the rest of the business. But I don't want to make a blanket statement about how to organize files and i/o without knowing a whole lot more about what you're doing. (Not that I want to know -- I've got enough problems of my own. ;-)

    HTH

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found