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

Re: type glob problem

by rir (Vicar)
on Mar 03, 2009 at 22:11 UTC ( #747918=note: print w/replies, xml ) Need Help??

in reply to type glob problem

nagalenoj gave you the correct info; I'm just stating it another way. Your my @arra and your *arra are different and unrelated variables. The *arra is a package variable *main::arra which can, as a typeglob, refer to the variable @main::arra but that has nothing to do with a lexical, aka my, variable named @arra.

You are passing an empty typeglob to doublevalue. This demonstrates that you are passing nothing, loosely speaking, to your function:

my @arra = (10,20); print ">@main::arra<$/"; print ">>@arra<<$/";
Update: With your code, use warnings; would have flagged that the name main::arra was used only once, hinting at the problem. With use diagnostics; the message is more confusing as if it were written before lexical variables were added to the language.

Be well,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://747918]
[karlgoethebier]: hello jedikaiti! something shiny tonight?
[jedikaiti]: It's a very pretty shiney
[jedikaiti]: Shiney!
[karlgoethebier]: very nice!
[shmem]: hm. Can't resolve - weird.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-11-21 18:00 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (308 votes). Check out past polls.