PhraSEOlogy

msg:435957 | 7:26 pm on Jan 20, 2005 (gmt 0) |
Try googling: defining local variables my You will find some good information on how to use 'my' and why to use it.
|
Lord Majestic

msg:435958 | 7:29 pm on Jan 20, 2005 (gmt 0) |
Once you waste a few good hours debugging your software only to find out that bug was due to local variable with the same name as global, thus masking global var's value that you actually needed, you will appreciate necessity to always "use strict" in Perl, and therefore use "my" to declare variables explicitly.
|
runner

msg:435959 | 7:34 pm on Jan 20, 2005 (gmt 0) |
I guess that answers my question!
|
SeanW

msg:435960 | 4:11 pm on Jan 21, 2005 (gmt 0) |
always "use strict" in Perl, and therefore use "my" to declare variables explicitly |
| If there were one thing every perl newbie should learn, that is it. Sean
|
moltar

msg:435961 | 4:14 pm on Jan 21, 2005 (gmt 0) |
use strict and my saves hours of development time on daily basis :)
|
satanclaus

msg:435962 | 6:26 pm on Jan 24, 2005 (gmt 0) |
Pick up the Oreilly Programming Perl book and look at the scoping functions in chapter 29 which lists all the functions. That chapter alone has pushed me far into PERL usage.
|
wruppert

msg:435963 | 3:21 am on Feb 1, 2005 (gmt 0) |
Definitely strongly agree with "use strict". Also, "use warnings" (or perl -W) and provide prototypes for your subroutines.
|
runner

msg:435964 | 10:52 pm on Feb 1, 2005 (gmt 0) |
I've got <i>Programming Perl</i> third edition. I'll read chapter 29 tonight. I'm almost afraid to become enlightened because I'll have to go and rewrite all my scripts. I'd better get started.
|
moltar

msg:435965 | 11:15 pm on Feb 1, 2005 (gmt 0) |
Actually, once you learn a few perl tricks, you will love it! And you will write scripts much faster. There will be no way back. Perl helps me every day!
|
|