Here's my save function:
The output function just calls $world->note, and &__room_save saves a room.
I tested it out beforehand through the command line, and it saved the file perfectly. When I try to save when it's running as a PerlScript, everything returns correctly, but nothing is ever written.
I understand that there may be limitations on scripts that make them unable to read/write files... But, is there a way around this without having to open a log file and writing to it (if that will even work at all)?
Does this mean that the script can't read files either? Is there a workaround to reading files?
sub __save {
my ($filename) = $_[0];
unless(open(OUT, ">$filename")) {
output("Cannot open $filename: $!");
return;
}
print OUT $area_name . "\n";
foreach (@area) {
print OUT &__room_save($_) . "\n";
}
close OUT;
return 1;
}
The output function just calls $world->note, and &__room_save saves a room.
I tested it out beforehand through the command line, and it saved the file perfectly. When I try to save when it's running as a PerlScript, everything returns correctly, but nothing is ever written.
I understand that there may be limitations on scripts that make them unable to read/write files... But, is there a way around this without having to open a log file and writing to it (if that will even work at all)?
Does this mean that the script can't read files either? Is there a workaround to reading files?