Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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

Comment on Re: Up for Critique
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-11-28 23:20 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls