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

Re^2: Scalar followed by parenthetical...

by LanX (Saint)
on May 19, 2013 at 02:56 UTC ( [id://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)

Replies are listed 'Best First'.
Re^3: Scalar followed by parenthetical...
by BrowserUk (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1034184]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-23 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found