Code Comments
Programming Forum and web based access to our favorite programming groups.Hello everybody,
Can anyone tell me why this simple code does not work?
<Job ID="Test">
<script language=PerlScript>
$objFSO = $WScript->CreateObject("Scripting.FileSystemObject");
$objFile = $objFSO->CreateTextFile("test2.txt", ForWriting);
$objFile->WriteLine("Hello");
</script>
</Job>
I got this error:
Error: (in cleanup) Can't call method "Writeline" on an undefined value
I suspect something with FileSystemObject but I could not find anything on t
he web and I have been searching for some days :-((((
..but the same code in java or VBscript works.
Any help will be really well apreciated.
Thanks in advance.
---------------------------------
You rock. That's why Blockbuster's offering you one month of Blockbuster Tot
al Access, No Cost.
Post Follow-up to this messageFrom: oscar gil <racsolig@yahoo.com>
> Hello everybody,
>
> Can anyone tell me why this simple code does not work?
>
> <Job ID="Test">
> <script language=PerlScript>
>
> $objFSO = $WScript->CreateObject("Scripting.FileSystemObject");
> $objFile = $objFSO->CreateTextFile("test2.txt", ForWriting);
>
> $objFile->WriteLine("Hello");
>
>
> </script>
> </Job>
>
> I got this error:
> Error: (in cleanup) Can't call method "Writeline" on an undefined value
>
> I suspect something with FileSystemObject but I could not find anything on the web
and I have been searching for some days :-((((
You would only use Scripting.FileSystemObject if you are a strong
masochist.
open my $OUT, '>', "test2.txt" or die "Failed to open: $^E\n";
print $OUT "Hello\n";
just like in normal Perl.
And most likely the problem is permissions. The account undex which
the ASP page runs doesn't have enough permissions to create the file
in the current directory.
Jenda
===== Jenda@Krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.