Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Sub Params as references

by tstock (Curate)
on Aug 14, 2002 at 03:33 UTC ( [id://189982]=note: print w/replies, xml ) Need Help??


in reply to Sub Params as references

What wrong assumptions have I made?

my $lines_in  = ${shift()};

you made a copy of a variable instead of using the reference to the variable. your code will work if you do:
my $lines_in = shift; [...] $$lines_in .= $_;
Tiago
Update: check out perlref if you want to know more about references.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-16 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found