yburge has asked for the wisdom of the Perl Monks concerning the following question:
Okay, people, she's BAAAACK! My apologies for the elementary nature of my questions, but I am not now, nor have I ever been, a programmer. Closest I've come is JCL maintenance on MVS mainframes, which kind of explains why I have this question....
What is the syntax for assigning values to local variables? Here are a couple of examples:
local $GTENV = ltcd; # local = available for whole script? my $BNAME = ICVALID; # my = NOT available to subroutines? my $GTSTARTUP_T = "O:\Tools\GraphTalkDeveloper\R3212\bin\GTvrtt.exe"; + # enclose values w/ spec chars in ""s?
Is there a standard for how many spaces to leave between the variable name and the assignment operator? How does one know whether to enclose a value in single-quotes, double-quotes, parentheses, or nothing? Does it look like I understand correctly (if at a really basic level) the use of "my" vs. "local"?
I SWEAR I have RTFM, so to speak (searched online & in the 4 Perl books I have), but I must have missed it, assuming it's there. Any hints on where to find the answers? Thanks for your patience; you monks seem to be to have the largest volume of it of any usenets.
20060427 Janitored by Corion: Added formatting, code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: local variable syntax
by fishbot_v2 (Chaplain) on Apr 26, 2006 at 23:37 UTC | |
by yburge (Acolyte) on Apr 27, 2006 at 01:14 UTC | |
by fishbot_v2 (Chaplain) on Apr 27, 2006 at 02:43 UTC | |
by yburge (Acolyte) on Apr 27, 2006 at 19:30 UTC | |
by jdporter (Paladin) on Apr 27, 2006 at 13:46 UTC | |
by fishbot_v2 (Chaplain) on Apr 27, 2006 at 14:31 UTC | |
by jdporter (Paladin) on Apr 07, 2011 at 16:54 UTC | |
|
Re: local variable syntax
by davido (Cardinal) on Apr 27, 2006 at 03:31 UTC | |
|
Re: local variable syntax
by cdarke (Prior) on Apr 27, 2006 at 01:32 UTC |