Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: Scalar followed by parenthetical...

by ikegami (Pope)
on May 19, 2013 at 07:28 UTC ( #1034197=note: print w/ replies, xml ) Need Help??

in reply to Re: Scalar followed by parenthetical...
in thread Scalar followed by parenthetical...

...maybe it's a side-effect of how those specially named variables are vivified. Oh, and strike that "maybe" :)

Comment on Re^2: Scalar followed by parenthetical...
Replies are listed 'Best First'.
Re^3: Scalar followed by parenthetical...
by tobyink (Abbot) on May 19, 2013 at 17:27 UTC

    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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (17)
As of 2016-02-11 17:41 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (376 votes), past polls