Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: how to make a package variable as c++

by aitap (Deacon)
on Nov 04, 2012 at 09:37 UTC ( #1002177=note: print w/ replies, xml ) Need Help??


in reply to how to make a package variable as c++

#Error here: Useless use of hash element in void context $singleton->{$XMLfile_name}=>$_;
something => another_thing means "something", another_thing (note the quotes, see Comma Operator for more info). Did you mean just "="?

You also seem to use $_ instead of elements in @_. Fuction arguments are in the @_ array (which is modified by shift, by the way), not in the single $_ scalar variable.

Sorry if my advice was wrong.


Comment on Re: how to make a package variable as c++
Select or Download Code
Re^2: how to make a package variable as c++
by Anonymous Monk on Nov 04, 2012 at 09:44 UTC
    Yes, the error due to a typo. Thanks!
Re^2: how to make a package variable as c++
by Anonymous Monk on Nov 04, 2012 at 09:49 UTC
    Thanks Aitap, I alway forget that by using $_ instaed of $_[0]. But seems I can't fix/update the post after replied.
Re^2: how to make a package variable as c++
by anaconda_wly (Scribe) on Nov 04, 2012 at 09:53 UTC
    I didn't noticed I'm logged out. I have changed the error. But could you or anyone else please give me any directions of my questions?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2015-07-06 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (80 votes), past polls