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

Re: Up for Critique

by davorg (Chancellor)
on Mar 23, 2002 at 17:01 UTC ( #153803=note: print w/replies, xml ) Need Help??

in reply to Up for Critique

In a couple of places you change the value of $/ to make it easier to read in your input records. In general when changing any of Perl's "special" variables, it's a good idea to get into the habit of localising that change as much as possible. For example:

{ # start a new code block local $/ = "-----"; # do whatever processing you need to do with the # changed value in $/ } # End of block, $/ reverts to previous value

With the change localised like that you don't run the risk of forgetting what value is in the variable later on in your program. This is particularly important when you're writing modules for other people to use as you don't want to be changing the value of these variables in someone elses code :)


"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://153803]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2018-04-21 04:23 GMT
Find Nodes?
    Voting Booth?