in reply to Re^4: How to Save Fetched Web Files as "path/$string.xml"
in thread How to Save Fetched Web Files as "path/$string.xml"
Always use strict;. If that reports errors you don't understand, reduce the code to a simple example that shows the error and ask here about it. There are very few situations where you are ever likely to need to turn strictures off, and even for most of those there are likely to be better ways to achieve what you want.
Avoid referring to code on your scratch pad - it's transient but the node that referees to it will be around for a while. Include the code with your node.
In your scratch pad code you have:
print "\t\tfetching game: $game\n"; open(FILEHANDLE, ">","$outputdir/players.xml") or die "could not open file $game/players.xml: $|\n"; print FILEHANDLE "$game\n";
which confuses me because you say you are opening a different file than that which you pass into the open. I'd be inclined to do something like:
my $filename = "$outputdir/players.xml"; print "\t\tfetching game: $game\n"; open(FILEHANDLE, ">", $filename) or die "could not open file $filename: $!\n"; print FILEHANDLE "$game\n";
BTW, $! is the special variable that contains the last OS error.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How to Save Fetched Web Files as "path/$string.xml"
by nase (Novice) on Aug 23, 2007 at 06:53 UTC |