We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It is. The way the punctuation variables are implemented, if $X exists (assuming X is a punctuation character), then @X and %X also exist. There are one or two CPAN modules that make use of the magic global %_. MooseX::Params is an example. With a bit of digging around in perlvar you can figure out plenty of spare global variables. I use them occasionally in local code (%\ is one of my favourites), but have so far resisted the urge to publish anything using them. Global variables don't usually make for very good reusable code.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In reply to Re^3: Scalar followed by parenthetical...
by tobyink
|
|