ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Re: PerlScript - FileSystemObject - Windows Scrpting Host
by Jenda Krynicky other posts by this author
Apr 2 2008 2:55PM messages near this date
FW: ActivePerl-5.8.8.822-MSWin32-x86-280952.msi HTML documentation malformed | RE: PerlScript - FileSystemObject - Windows Scrpting Host [SEC=UNCLASSIFIED]
From: oscar gil <racsolig@[...].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 h
ave 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@[...].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

_______________________________________________
ActivePerl mailing list
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Jenda Krynicky
Ken Barker

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved