Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

(cLive ;-) Re: $_ haters anonymou

by cLive ;-) (Prior)
on Jan 25, 2002 at 04:16 UTC ( [id://141383]=note: print w/replies, xml ) Need Help??


in reply to Re: $_ haters anonymou
in thread $_ haters anonymou

you don't want to have to say $main::^M everywhere.

i blinked b4 replying, but you don't have to:

$::^M is equivalent to $main::^M - 'main' is the default namespace.

Or have I grabbed the wrong end of a pointy stick?

cLive ;-)

Replies are listed 'Best First'.
Re: $_ haters anonymou
by Dominus (Parson) on Jan 25, 2002 at 19:05 UTC
    Says cLive ;-):
    $::^M is equivalent to $main::^M - 'main' is the default namespace.
    Actually they're both syntax errors.

    If they weren't syntax errors, then yes, the variable $::^M is identical to $main::^M. But not because main is the default namespace. It's because the empty stash name is interpreted as though you had said main instead. See line 579 of gv.c:

    if (!*name) return gv ? gv : (GV*)*hv_fetch(PL_defstash, "main::", + 6, TRUE);
    If the name turns out to have been empty, Perl looks up the main stash instead.

    --
    Mark Dominus
    Perl Paraphernalia

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (None)
    As of 2024-04-25 01:43 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found