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.

In reply to Ubuntu: drag files/folders onto perl script and get their names in @ARGV by westmj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.