[thelist] win32 perl, maxlength for @argv?

Sam sam at sam-i-am.com
Tue May 28 13:27:01 CDT 2002


> i would recommend that you split up your commands into sequential calls
> (that might mean changing the way your program works though...)
>
> something like this in a batch file (i assume your files are named
> sequentially ...)
> for %%d in (1 2 3 4 5 6 7 8 9 10 11...) do abc.exe  file%d.txt

the filenames are really arbitrary, it's just whatever the user happens
to have selected and dropped on there (or Sent to). I should probably
back up and explain what I'm trying to achieve, maybe there's another
better way.

I want to be able to select files in a Win32 Find/Explorer window, and
do [stuff] to them.
My language of choice is perl, its what I know (though javascript might
be ok too).
The 2 mechanisms I'm looking at are a "droplet" - an executable that I
can drag and drop my files onto (the filenames turn up in the @ARGV
array, but the 2046 byte command line limitation seems to be in effect
this way), OR I'm now looking at adding a  Send To shortcut to my
application, so I'd select files > Send To mystuff.exe (same limitation
apparently)

The kinds of things I want to do to these files: strip/condense
whitespace, produce a filename listing, refresh content/template, etc. I
have perl scripts that do most of this already, but I have to invoke via
the commandline, and typing/pasting in each filename onto the
commandline is a pain (and I have the same 2046 byte limitation here
too). So what I normally do is create a filelist (eg. dir /A /S *.html >
filelist.txt) which I can edit by hand, and then pass that to the
script. (

But I like the GUI method in this case - select the files you want to
process, and push them over to your app. It lets me sort by, filter, etc
visually in the Explorer, add/remove files as needed from the selection.

So... I does sound like adding a WSH script to capture the filenames,
and then calling the perl script/exe for each one might be the best way.
I'll look into it, but look forward to hearing any other comments.

Sam

> HTH
> ashok

it does, thanks a lot.



More information about the thelist mailing list