Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Re: a learning exercise - diary program

by a (Friar)
on Jan 27, 2001 at 09:56 UTC ( #54725=note: print w/ replies, xml ) Need Help??

in reply to Re: a learning exercise - diary program
in thread a learning exercise - diary program

Just a guess, but there may be a misunderstanding in the reuse of *diary.

@diary = 'path/to/diary.txt'; open(DIARY,">>@diary") or die "can't open file: $!";
(its a good idea to do 'or die "can't open @diary: $!"' well not '@diary' but the var holding the file name in the die stmt, as in 'or die "can't open diary file $file: $!"') is odd and just sort of lucky. You're mixing the Array @diary in a scalar context, er, I think that'll just make
$diary[$[] eq "/path/to/diary.txt";
fortunately, putting the @diary in a quote context unrolls it as if join("", @diary) which gives you back "/path/to/dairy.txt"


Comment on Re: Re: a learning exercise - diary program
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2015-10-10 05:03 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (254 votes), past polls