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

Re: Using Global Variables in Perl

by FunkyMonk (Chancellor)
on Apr 22, 2008 at 22:53 UTC ( #682297=note: print w/replies, xml ) Need Help??


in reply to Using Global Variables in Perl

I don't want to $readMode by way of a subroutine
Why not?

Global variables are evil. OO is the way to go.


Unless I state otherwise, my code all runs with strict and warnings

Replies are listed 'Best First'.
Re^2: Using Global Variables in Perl
by jkva (Chaplain) on Apr 23, 2008 at 11:07 UTC

    I guess by that logic I should convert all my little procedural syadmin perl scripts to OO? ;-)

    I'm more of a proponent of the "Right Tool for the Right Job"... :) It depends on what you're building.

      I honestly don't suggest or condone the use of global variables in this aspect... If you have the time to write out $varname you have the ability to just hard code >> << > < also like to point out your variable names are already identifyers it really needs to be just standard variables in this case however an option for global shared variables in the $_ENV in perl to control global variables over your filehandle multiplexing codes.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-09-29 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?