in reply to Having trouble creating a text file
In your first snippet, one problem could be where "$storyfile" comes from. Is a portion of it coming from a source that taint mode would frown upon? That's my thought; that you'e accepting at least a portion of $storyfile from a source that could be considered tainted (or taintable).
In your second snippet, you're not even opening the file for output; you're opening it for input. And "Could not write..." is fooling you; it's your own error message. It should actually say, "Could not read from..." (since you're opening the file for reading in that second snippet). And the reason it's failing to open for reading is probably that it doesn't exist yet since you haven't written it yet.
By the way; use the three-arg version of open: open STORY, '>', $storyfile or die .....
Oh, that reminds me of another problem; in your first snippet you're using the wrong "or"; since there aren't any parens around the open argument list, you need to use "or" instead of "||", or else you get into precedence trouble.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Having trouble creating a text file
by greymoose (Beadle) on May 06, 2007 at 23:56 UTC | |
by davido (Cardinal) on May 08, 2007 at 04:28 UTC | |
by greymoose (Beadle) on May 08, 2007 at 05:47 UTC | |
by davido (Cardinal) on May 09, 2007 at 04:18 UTC |