IIRC Win don't pass arguments to programs started by
"extension association" (even when Win Registry is set
up completely). I don't know why this is.

Workaround is to use pl2bat script which encapsulates
the perl source within a .bat file and handles
everything as necessary.

It is the way already suggested here, I just wanted to
point out the PL2BAT script, which is part of
ActivePerl (at least..).

CD \DIRECTORY\WITH\MY\SCRIPT
PL2BAT my-program.pl

Then you have my-program.pl and my-program.bat

Start it as any other .bat file

When you make changes to your perl program, be sure to
run PL2BAT again when you're finished. Otherwise you
might be quite surprised why your chnages didn't wotk
(unless you run it as 'perl my-program.pl').

Jindra Vavruska

CD to the directory 
--- Tim Musson <[EMAIL PROTECTED]> wrote:
> Hey ggage,
> 
> Friday, June 08, 2001, 12:17:50 PM, you wrote:
> 
> gmc> I would like to run a perl script and pass in
> an argument (ARGV[0]) by
> gmc> dragging a textfile icon on to the perl script
> icon.  This would be on an
> gmc> NT/Win2000 system using the icons in file
> manager, desktop, etc.  The
> gmc> argument passed in would be the path to the
> textfile.  This works with a
> gmc> DOS batfile, but I'm having trouble with a
> ".pl" file.
> 
> Did you try wrapping your perl code in M$ batch code
> and making it a
> .bat file instead of a .pl file?  for example:
> 
> ============== start of wrapping.bat ==============
> 
> @rem & @echo off
> @perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
> @goto EndOfPerl
> @rem ';
> #!/perl -w
> 
> #Sec=$T[0],M=1,H=2, mDay=3,Mon=4,Yr=5,
> wDay=6,yDay=7, isdst=8
> @T=localtime(time); $T[4]++; $T[5]=1900+$T[5];
> $DTS="$T[5]/$T[4]/$T[3]-$T[2]:$T[1]"; 
> 
> print "\nIt's $DTS, you just ran $0, check it
> out.\n\n";
> 
> __END__
> :EndOfPerl
> @pause
> 
> ============== end of wrapping.bat ==============
> 
> -- 
> [EMAIL PROTECTED]
> Using The Bat! eMail v1.51
> Windows NT 5.0.2195 (Service Pack 1)
> Always remember to pillage BEFORE you burn.
> 
> 
> 
> NetZero Platinum
> No Banner Ads and Unlimited Access
> Sign Up Today - Only $9.95 per month!
> http://www.netzero.net


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to