Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: use strict with Getopt::Std

by larsen (Parson)
on Mar 19, 2003 at 21:51 UTC ( [id://244473]=note: print w/replies, xml ) Need Help??


in reply to use strict with Getopt::Std

With my you don't create a global, but a lexical. You want to
use vars qw/$opt_J ... and so on .../;
at the top of your program. This way, you'll tell your program that you're going to use those global variable names, and strict won't complain. I suggest to read Lexical scoping like a fox and Coping with Scoping. I think there will be a column by merlyn on this subject soon.

Replies are listed 'Best First'.
Re: Re: use strict with Getopt::Std
by cutter (Acolyte) on Mar 19, 2003 at 22:01 UTC
    Thanks for the hints. I am just learning perl and trying to get my mind wrapped around the concept of scoping. This is what happens when you give a polsci major a computer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found