Re: perl in Windows: using the "Send To" folder and perl
From: A. Sinan Unur (1usa_at_llenroc.ude.invalid)
Date: 09/23/04
- Next message: Greg Bacon: "Re: Untainting a filehandle"
- Previous message: Polleke: "Re: Mystery message: Undefined subroutine &OS2::Bootdrive"
- In reply to: Adam S: "perl in Windows: using the "Send To" folder and perl"
- Next in thread: Ben Morrow: "Re: perl in Windows: using the "Send To" folder and perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Sep 2004 12:45:50 GMT
adam_at_vnl@postmaster.co.uk (Adam S) wrote in
news:c9164b54.0409230247.18ac7dc9@posting.google.com:
> with a few thousand lines worth of Perl programmnig in a Unix
> environment behind me I want to create an application in Windows where
> I can mark several files and then right-click and do a "Send To" to a
> perl application.
Well, this is not strictly a Perl question but ...
> When using the "Send To" right-click menu item, all the files I've
> marked are supplied on the command line to the executable i.e.
>
> myexecutable file1.txt file2.txt ... fileN.txt
>
> I create my executable by writing a .bat file which in turn supplies
> the input argument with a
>
> eval "perl myperlscript.pl @ARGS" statement.
>
> My first version of myperlscript.pl only printed all the file names
> supplied to to stdout just to check how many files I can do.
>
> That's where the problem arises, somewhere along the line it only
> manages about 5 files (the path names are rather long, about 50
> characters.
>
> Somewhere the command line gets very short, I don't exactly know
> where, if itäs the .bat command line that's too short or the perl
> command line.
You do not mention which Windows command shell you are using. command.com
has always been hampered by very short line lengths (numbers like 127 and
255 come to mind). AFAIK, cmd.exe in XP is better but I don't know how much
better.
> Other "proper" applications, such as gVim, don't seem to have a
> problem with 50 similar file names being supplied.
>
> If the solution is to create a perlscript.exe, how do I do that so I
> can get rid of the .bat file to launch the perl interpreter? In a Unix
> environment I would just add a #!/usr/bin/perl and the script itself
> would be an executable, but how do I do it in Windows without
> involving a .bat file? Or is there an entirely different solution
> where I can do a #! like addition to my script?
Untested: A solution that might work regardless of the version of Windows
you are using is to create a shortcut to wperl.exe and specify the script
name and command line parameters via that shortcut.
Hope this helps.
Sinan.
- Next message: Greg Bacon: "Re: Untainting a filehandle"
- Previous message: Polleke: "Re: Mystery message: Undefined subroutine &OS2::Bootdrive"
- In reply to: Adam S: "perl in Windows: using the "Send To" folder and perl"
- Next in thread: Ben Morrow: "Re: perl in Windows: using the "Send To" folder and perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|