Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Scalar followed by parenthetical...

by LanX (Canon)
on May 19, 2013 at 02:56 UTC ( #1034184=note: print w/ replies, xml ) Need Help??


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

> Not a bug.

> Might have expected a warning though?

Since the OP's code uses strict it should die with

Global symbol "%_" requires explicit package name at ... Execution of ... aborted due to compilation errors.

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re^2: Scalar followed by parenthetical...
Select or Download Code
Re^3: Scalar followed by parenthetical...
by BrowserUk (Pope) on May 19, 2013 at 03:58 UTC

    But isn't %_ immune to strict in the same way and for the same reasons as $_ and @_?

    C:\test>perl -cmstrict -E"say %_" -e syntax OK

    That is, they are all 3 a part of the same typeglob.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

        See perlvar (for 5.10) when there was a section entitled "Technical Note on the Syntax of Variable Names", which contained the paragraph:

        Perl identifiers that begin with digits, control characters, or punctuation characters are exempt from the effects of the package declaration and are always forced to be in package main; they are also exempt from strict 'vars' errors.

        Seems to have disappeared from later versions.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2014-09-17 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (62 votes), past polls