Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PerlScript - FileSystemObject - Windows Scrpting Host
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Oscar Gil
04-03-08 12:19 AM


Re: PerlScript - FileSystemObject - Windows Scrpting Host
From: 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


Report this thread to moderator Post Follow-up to this message
Old Post
Jenda Krynicky
04-03-08 12:19 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:56 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.