Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Missing Bracket

by PerlingTheUK (Hermit)
on Nov 30, 2005 at 00:55 UTC ( [id://512808]=note: print w/replies, xml ) Need Help??


in reply to Re: Missing Bracket
in thread Missing Bracket

Excuse me for being curious but what is %(? I cannot find that documented anywhere. Why does use strict; not require a declaration for this hash?

Cheers,
PerlingTheUK

Replies are listed 'Best First'.
Re^3: Missing Bracket
by BrowserUk (Patriarch) on Nov 30, 2005 at 01:09 UTC

    (Almost?) every non-alpha printable character is used as a global variable for something. In this case, $( is defined in perlvar as $REAL_GROUP_ID (Whatever that is:).

    But every global scalar, is just one part of a 'glob', which also has 6 (or 7?) 'slots' (*).

    You are familiar with $_ and @_, well there is also a %_ which doesn't see much use outside golf. So it is with all other globals, the are $|, @| & %|, only the first of which has a predefined use, but the others exist and are usable as with any other general purpose global.

    (*). I forget exactly what they all are, but broquaint did a very good tutorial on them somewhere. See that for the full SP. Try supersearch for tutorial glob and author broquaint.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Missing Bracket
by GrandFather (Saint) on Nov 30, 2005 at 01:02 UTC

    It isn't anything. I suspect that graphic characters (non alphanumeric) get special treatment because of their use as special variables (like %! for example). Try running the code. :)


    DWIM is Perl's answer to Gödel
Re^3: Missing Bracket
by davido (Cardinal) on Nov 30, 2005 at 01:28 UTC

    It isn't actually anything, ie it's not used as a Perl special variable. However, all punctuation variables are essentially considered special whether they have meaning or not. This is documented in perlvar where it says...

    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.


    Dave

      Mhm, tricky one. I try to see a reason for this but fail.

      Cheers,
      PerlingTheUK

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 09:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found