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.
(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 = 'path/to/diary.txt'; open(DIARY,">>@diary") or die "can't open file: $!";
fortunately, putting the @diary in a quote context unrolls it as if join("", @diary) which gives you back "/path/to/dairy.txt"$diary[$[] eq "/path/to/diary.txt";
a
|
---|
In Section
Seekers of Perl Wisdom