Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: What is the scope of $_?

by kennethk (Monsignor)
on Nov 26, 2012 at 18:40 UTC ( #1005740=note: print w/ replies, xml ) Need Help??

in reply to Re: What is the scope of $_?
in thread What is the scope of $_?

<tangent> How is @_ not global in scope? I mean, it gets implicitly localized on any subroutine call, but it's present by default and package independent:

use strict; use warnings; @_ = @ARGV; package Foo; print for @_; @_ = qw(1 2 3 4 5); { local @_ = reverse @_; print for @_; } package main; print for @_;


Comment on Re^2: What is the scope of $_?
Select or Download Code
Re^3: What is the scope of $_?
by tobyink (Abbot) on Nov 26, 2012 at 19:35 UTC






Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-12-26 10:33 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (171 votes), past polls