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

RE: PerlScript - FileSystemObject - Windows Scrpting Host [SEC=UNCLASSIFIED]
=20

-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Jenda
Krynicky
Sent: Thursday, 3 April 2008 08:55 AM
To: ActivePerl@listserv.ActiveState.com; beginners@perl.org
Subject: Re: PerlScript - FileSystemObject - Windows Scrpting Host

From: oscar gil <racsolig@yahoo.com>
> Hello everybody,
>   =20
>   Can anyone tell me why this simple code does not work?
>   =20
>   <Job ID=3D"Test">
>   <script language=3DPerlScript>
>   =20
>   $objFSO =3D $WScript->CreateObject("Scripting.FileSystemObject");
>   $objFile =3D $objFSO->CreateTextFile("test2.txt", ForWriting);
>   =20
>   $objFile->WriteLine("Hello");
>   =20
>  =20
> </script>
> </Job>
>  =20
> I got this error:
> Error: (in cleanup) Can't call method "Writeline" on an undefined=20
> value
>  =20
> I suspect something with FileSystemObject but I could not find=20
> 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
=3D=3D=3D=3D=3D Jenda@Krynicky.cz =3D=3D=3D http://Jenda.Krynicky.cz =
=3D=3D=3D=3D=3D 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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

ForWriting is not defined. You should check the values returned
CreateObject and CreateTextFile.

Cheers,
Ken.



Report this thread to moderator Post Follow-up to this message
Old Post
Ken Barker
04-03-08 01:11 PM


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:57 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.