Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: open to a scalar variable

by kwaping (Priest)
on Jun 04, 2007 at 21:55 UTC ( #619242=note: print w/ replies, xml ) Need Help??


in reply to open to a scalar variable

I'm not very familiar with this technique, but try this instead:

open(MESSAGE, "+>>", \$message) or die "no message $!"; open(WHOM, ">>&=", MESSAGE) or die "no whom $!"; open (WHAT, ">>&=", MESSAGE) or die "no what $!";
If $message is already a reference, try dropping the backslash too.

---
It's all fine and dandy until someone has to look at the code.


Comment on Re: open to a scalar variable
Select or Download Code
Replies are listed 'Best First'.
Re^2: open to a scalar variable
by girarde (Friar) on Jun 05, 2007 at 14:04 UTC
    $message is declared but not defined until the reference assignment is made.

    Anyway, unquoting $message and putting the &= into the mode argument worked. Thank you.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2015-07-30 12:39 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 (271 votes), past polls