Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help!
by btrott (Parson) on Apr 24, 2000 at 10:19 UTC | |
You open test.txt (you should be checking the returns of your opens and any other function that uses the system!) for writing, then you try to read from it. I don't think that's going to work like you want it to, at all. And in fact what you've done is overwritten what was already in @text. What do you want in @text, anyway? Basically everything in test.txt previously, plus the new stuff? There are several ways to do this, but one of the simplest is this:
And check the return status of your open calls! :) If this doesn't help, be more specific about what isn't working. | [reply] [d/l] |
|
Re: Help!
by chromatic (Archbishop) on Apr 24, 2000 at 18:52 UTC | |
| [reply] [d/l] |
|
Re: Help!
by BBQ (Curate) on Apr 24, 2000 at 17:31 UTC | |
By doing this, you can later on make is so that each one of you're posters can re-edit his own post, generate stats, clean-up old messages and other cool things of the sort... Forums were the way that I learned perl in the 1st place. Forums are fun! #!/home/bbq/bin/perl # Trust no1! | [reply] [d/l] |
|
Re: Help!
by turnstep (Parson) on Apr 24, 2000 at 21:08 UTC | |
Not only is it easier to write, and it allows you to use real quotes, but easier to read the HTML produced: your code as it was put all of your text on a single line! | [reply] [d/l] |