westmj has asked for the wisdom of the Perl Monks concerning the following question:
Two closely related questions below for the wise...
I know how to run perl scripts at the Linux command line, e.g.
$ perl -e 'foreach $arg (@ARGV) { print "$arg\n";}' 1 2 1 2
Then on Windows desktop, I can go and fiddle the registry to allow me to drag and drop folder and file icons onto the perl script icon, and their fully qualified path names are in @ARGV, which would print out as above, or I can use in the program for reading, etc.
(1) How do I this latter drag and drop on Ubuntu? And hey, Mac instructions will be great too, but I plan to look into Platypus, and that may do it.
Next, I may have screwed up something related. Under file properties for my .pl files, the File type is "Perl script", but the 'open with' is jEdit, my preferred text editor. If I try to 'customize' back to opening with perl, I can not find the perl program (I guess as a .desktop file), so I assume I need a custom command line. In windows, that would be something like:
C:\path\perl '%f' %*
if memory serves, to pass the target script name and the passed parameters.
(2) What would be the proper custom line here? Or a proper .desktop file that passes the dropped icons or passed parameters?
Thanks very much.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ubuntu: drag files/folders onto perl script and get their names in @ARGV
by NetWallah (Canon) on Sep 16, 2016 at 04:10 UTC | |
by westmj (Initiate) on Sep 16, 2016 at 07:40 UTC | |
|
Re: Ubuntu: drag files/folders onto perl script and get their names in @ARGV
by westmj (Initiate) on Sep 16, 2016 at 19:52 UTC |