Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Builtin functions defaulting to $_

by shmem (Chancellor)
on Mar 24, 2007 at 13:53 UTC ( [id://606412]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Builtin functions defaulting to $_
in thread Builtin functions defaulting to $_

You don't have to memorize which symbols are true globals either.
which will relieve a lot of grief. Like with $! and $@ which may get overwritten if not dealt with in a timely manner. If I well remember, $! will be just a reference to what the current error looks like; therefore the question: what's $@ in Perl 6, if it exists at all? I could think of that as a list of messages of what things blew up from there to here (ie some "exception stack trace excerpt") - but then, that would be more appropriately @$! (in perl5 syntax, that is)...

update: reading again, not "have(ing) to memorize which symbols are true globals" means: there are no true global symbols, right?

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^4: Builtin functions defaulting to $_
by TimToady (Parson) on Mar 25, 2007 at 01:41 UTC
    There is no $@ in Perl 6; all errors are unified into the $! object, which can hold all the info it needs to. And in general, those few remaining punctuational variables are all lexically scoped.

    But what I meant was that you don't have to remember that names like STDIN and ARGV are the same symbol in every package. Those are now spelled $*IN and @*ARGS, where the * indicates true global scope; or perhaps just membership in the GLOBAL package, which as you point out arguably means there are no true globals.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-26 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found