Still no luck.  I'm using Windows 2000 Pro, by the way.

C:\>assoc | grep "\.pl"
File STDIN:
.pl=perl

C:\>ftype | grep perl
File STDIN:
perl=c:\ActiveState\Perl\Bin\perl.exe %1 %*

C:\>set | grep PATHEXT
File STDIN:
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PL;.pl

output:

C:\>test 1 2 3

C:\>

It works when I call it with perl explicitly

C:\>perl test.pl 1 2 3
1
2
3

Any ideas why this?




From: "Gerry Green" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Re: Passing command line options with ActivePerl
Date: Sun, 23 May 2004 18:47:51 -0400
MIME-Version: 1.0
Received: from listserv.activestate.com ([209.17.183.249]) by mc6-f33.hotmail.com with Microsoft SMTPSVC(5.0.2195.6713); Sun, 23 May 2004 15:51:49 -0700
Received: from listserv.activestate.com (localhost.localdomain [127.0.0.1])by listserv.activestate.com (8.12.10/8.12.10) with ESMTP id i4NMnoZU020229;Sun, 23 May 2004 15:50:01 -0700(envelope-from [EMAIL PROTECTED])
Received: from smtp3.ActiveState.com (latte.activestate.com [192.168.4.252])by listserv.activestate.com (8.12.10/8.12.10) with ESMTP idi4NMm2S4019884 for <[EMAIL PROTECTED]>;Sun, 23 May 2004 15:48:02 -0700(envelope-from [EMAIL PROTECTED])
Received: from smtp5.ActiveState.com (sack.ActiveState.com [192.168.2.149](may be forged))by smtp3.ActiveState.com (8.12.9/8.12.9) with ESMTP id i4NMm2WT009524for <[EMAIL PROTECTED]>; Sun, 23 May 2004 15:48:02 -0700
Received: from cartman (dhcp16477090.woh.rr.com [24.164.77.90])by smtp5.ActiveState.com (8.12.11/8.12.11) with ESMTP id i4NMlw8Z025532for <[EMAIL PROTECTED]>; Sun, 23 May 2004 15:47:59 -0700(envelope-from [EMAIL PROTECTED])
Received: from STAN ([192.168.0.171]) by cartman with MicrosoftSMTPSVC(6.0.3790.0); Sun, 23 May 2004 18:45:34 -0400
X-Message-Info: JGTYoYF78jGhy23XF/dP6mizWooRV7XL
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-OriginalArrivalTime: 23 May 2004 22:45:34.0885 (UTC)FILETIME=[A9038550:01C44117]
X-PMX-Version: 4.6.0.99824, Antispam-Core: 4.6.0.99824,Antispam-Data: 2004.5.22.101440
X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report='CLICK_BELOW 0.089,__OUTLOOK_MSGID_1 0, __SANE_MSGID 0, __TO_MALFORMED_2 0,__REFERENCES 0, __MIME_VERSION 0, __EVITE_CTYPE 0,__CTYPE_CHARSET_QUOTED 0, __CT_TEXT_PLAIN 0, __CT 0, __CTE 0,__HAS_X_PRIORITY 0, __HAS_MSMAIL_PRI 0, __OUTLOOK_MUA_1 0,__HAS_X_MAILER 0, __ANY_OUTLOOK_MUA 0, __HAS_OUTLOOK_IN_MAILER 0,__HAS_MIMEOLE 0, __HAS_XOAT 0, __CLICK_BELOW 0,QUOTED_EMAIL_TEXT 0, __MIME_TEXT_ONLY 0, __OUTLOOK_MUA 0,__HAS_MSGID 0, REFERENCES 0.000'
X-BeenThere: [EMAIL PROTECTED]
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: Discussions relating to ActivePerl on Win32 platforms<perl-win32-users.listserv.ActiveState.com>
List-Unsubscribe: <http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users>,<mailto:[EMAIL PROTECTED]>
List-Archive: <http://ASPN.ActiveState.com/ASPN/Mail/Browse/Threaded/perl-win32-users>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users>,<mailto:[EMAIL PROTECTED]>
Errors-To: [EMAIL PROTECTED]
Return-Path: [EMAIL PROTECTED]


Paul, try modifying the "PATHEXT" environment variable to include .pl. (add
a semicolon, followed by .pl)

To temporarily set it you can enter this at a command prompt:

    set PATHEXT=%PATHEXT%;.PL

To set it permanently go into the control panel and the system applet.

When you do this you don't even have to enter the .pl extension, just "test"
is enough to run your script, and the parameters are properly passed.


gerry

----- Original Message -----
From: "Paul Stepowski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 23, 2004 5:54 PM
Subject: Re: Passing command line options with ActivePerl


> Hi Bill,
>
> Thanks, it work when I prefix it with "perl", e.g.:
>
> c:\>perl test.pl 1 2
> 1
> 2
>
> C:\>
>
> Ideally I'd want to get around this so I only to type the name of the
> script. Do you know if there's a way of confuring Windows to relay the
> command line args if the program is called using a file extension (.pl)
> association?
>
> Cheers,
>
> Paul
>
>
> >From: "$Bill Luebkert" <[EMAIL PROTECTED]>
> >To: Paul Stepowski <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: Passing command line options with ActivePerl
> >Date: Sun, 23 May 2004 14:36:34 -0700
> >MIME-Version: 1.0
> >Received: from mta10.adelphia.net ([68.168.78.202]) by
mc3-f39.hotmail.com
> >with Microsoft SMTPSVC(5.0.2195.6824); Sun, 23 May 2004 14:36:37 -0700
> >Received: from computer ([67.20.95.49]) by mta10.adelphia.net
> >(InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with SMTP
> >id <[EMAIL PROTECTED]>; Sun,
23
> >May 2004 17:36:36 -0400
> >X-Message-Info: JGTYoYF78jGcU9AezkRD0YFt+einFfyL
> >Message-ID: <[EMAIL PROTECTED]>
> >User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4)
> >Gecko/20030624 Netscape/7.1 (ax)
> >X-Accept-Language: en-us, en
> >References: <[EMAIL PROTECTED]>
> >In-Reply-To: <[EMAIL PROTECTED]>
> >Return-Path: [EMAIL PROTECTED]
> >X-OriginalArrivalTime: 23 May 2004 21:36:37.0585 (UTC)
> >FILETIME=[06FDA410:01C4410E]
> >
> >Paul Stepowski wrote:
> >
> > > Hi,
> > >
> > > I've having trouble passing command line arguements to perl scripts
> >written
> > > in ActivePerl (v5.8.3). When I run the following script under linux,
it
> > > outputs my command line args as expected e.g.:
> > >
> > > ---snip---
> > > #/use/bin/perl
> > > #test.pl
> > >
> > > foreach (@ARGV) {
> > > print("$_\n");
> > > }
> > > ---snip---
> > >
> > > produces:
> > >
> > > # c:\test.pl 1 2
> > > 1
> > > 2
> > > #
> > >
> > > But the same script under ActivePerl doesn't, e.g
> > >
> > > ---snip---
> > > #!c:\ActivePerl\perl\bin\perl
> > > #test.pl
> > >
> > > foreach (@ARGV) {
> > > print("$_\n");
> > > }
> > > ---snip---
> > >
> > > C:\>test.pl 1 2
> > >
> > > C:\>
> > >
> > > Does ActivePerl handle passing command line arguments differently?
> >
> >Try explicitly calling Perl (depending on which Windoze & shell, you may
be
> >able to properly associate Perl to .pl and getting the results you
wanted)
> >:
> >
> >perl test.pl 1 2
> >
> >--
> > ,-/- __ _ _ $Bill Luebkert
Mailto:[EMAIL PROTECTED]
> > (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
> > / ) /--< o // // Castle of Medieval Myth & Magic
> >http://www.todbe.com/
> >-/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
> >
>
> _________________________________________________________________
> SEEK: Now with over 50,000 dream jobs! Click here:
> http://ninemsn.seek.com.au?hotmail
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_________________________________________________________________
Protect your inbox from harmful viruses with new ninemsn Premium. Go to http://ninemsn.com.au/premium/landing.asp?banner=emailtag&referrer=hotmail


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to