Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: perl handle and common variable

by dsheroh (Parson)
on Apr 08, 2013 at 09:48 UTC ( #1027454=note: print w/ replies, xml ) Need Help??

in reply to perl handle and common variable

Just to clarify some terminology that it appears you may have misunderstood: At the end of your second bit of posted code, $report_handler is a file handle. A "file handle" is the operating-system level resource used by programs to interact with files (and other file-like things, like pipes, stdin, stdout, etc.).

The difference you've discovered is the difference between a bareword (or typeglob) file handle (report_handler) and a lexical file handle ($report_handler). Bareword file handles mostly exist for the sake of backwards compatibility these days. Any new code should use lexical file handles instead.

Comment on Re: perl handle and common variable
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2015-10-09 22:38 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (253 votes), past polls