go ahead... be a heretic | |
PerlMonks |
Re: Check your CPAN modules for use varsby stevieb (Canon) |
on Jun 26, 2018 at 22:07 UTC ( [id://1217471]=note: print w/replies, xml ) | Need Help?? |
It's been already confirmed that you "misunderstood" the perldelta entry regarding use vars;, I just want to throw a piece of advice to you... It is advantageous to use variable names that are descriptive of the function they are being used for. It is very difficult to comprehend code that is full of variables that are single-letter, other than those that are pretty much iteration-type variables (or single-char vars that are used in an extremely small/tight context, but I'd still recommend against it). $c, $n, $f, $m, $g... even in your small few-line code script there, it becomes a bit overwhelming. Extra keystrokes matter when writing code, and they are especially important when reading code a couple of days, months or years later. At least in Perl, we don't have to define everything with a type, such as const char* thing (c) or nonsense like List<Thing> thing = new List<Thing>() (c#). We can just do my $thing. The my and the full name of the variable are very useful.
In Section
Cool Uses for Perl
|
|