Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: count multiple variables in a single array.

by Your Mother (Archbishop)
on Feb 28, 2020 at 19:43 UTC ( [id://11113562]=note: print w/replies, xml ) Need Help??


in reply to Re^2: count multiple variables in a single array.
in thread count multiple variables in a single array.

…changing directories it does get very confusing, but sometimes a necessary evil…

I am open to being shown incorrect but I don’t think it’s ever necessary and in every case I have come across it so far—including some of my own older stuff—I find it to be code smell.

  • Comment on Re^3: count multiple variables in a single array.

Replies are listed 'Best First'.
Re^4: count multiple variables in a single array.
by Marshall (Canon) on Feb 28, 2020 at 23:11 UTC
    I equivocated in my post to the OP.
    I also don't see any "necessary evil"
    Some Perl libraries like File::Find do chdir's for their work and error recovery from a something like that can be very problematic because you can wind up in some random directory. The &wanted routine should be as simple as possible to avoid this problem.
    In general, chdir is a bad idea.
    I could think of situations where a chdir to a program's data could simplify the code slightly, but I also don't see "necessary evil", meaning "required".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found