Hi!
I want a running perl script to process every dropped file dragged from Explorer, but I don't know how drag&drop work in Windows.
I wrote this simple script as test.pl to get an idea of what is happening when it is running in its own window after a double click:
#!perl use strict; use warnings; while (<>) { print $_; }
The result is that if I drag one file to the Strawberry perl window, I can see the file's full path, but I have to press the Enter key with the focus in that window to make the script get the file, i.e. to print back the path. This means that only the file path name is sent to the script, without a newline.
What if I drag multiple files to the perl window? Only one filename is received, and no newline...
Is there a module or exteral tool that I could use in order to receive dropped files to the running window? Is adding the handler to the registry in order to run the script by dropping files to its icon the only way?
Thanks!!!
Edit: I first tried a oneliner in CMD with the same result.
perl -pe ""In reply to How to process dropped files by vitoco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |