metawidget: A platypus looking pensive. (Default)
[personal profile] metawidget
Help!

I'm trying to get a Perl script wrapped in Platypus to set its working directory to the current one... it has an example using "$1/.." for sh, but I'm a total novice and don't know how to get perl to either do that right away or fold it into a system() call. I just want the script to run a command from the directory it's sitting in (I can't predict what directory the user will drop it in, but the files the command acts on will be in the right relative spots).

If anyone has an idea how to access what Platypus gives to sh as "$1" from Perl, or another way to do this, I'd be much obliged.

Date: 2006-03-29 11:22 pm (UTC)
From: [identity profile] pphaneuf.livejournal.com
The command-line parameters are given in @ARGV, so $1 would be available as $ARGV[0].

Date: 2006-03-29 11:26 pm (UTC)
From: [identity profile] http://users.livejournal.com/hub_/
I must admit I have hard time to understand what you want to do.

$1 in Perl is the Regexp back reference from the previous match (can be undefined)

$1 in Shell is the first argument passed to the shell script.

Date: 2006-03-30 01:22 am (UTC)
swestrup: (Default)
From: [personal profile] swestrup
Took a look at the Platypus site, but its not very informative. Give an example of a piece of perl code that's called from Platypus and we can probably deduce how the interface works.

Profile

metawidget: A platypus looking pensive. (Default)
metawidget
Page generated Jan. 21st, 2026 06:42 pm

June 2025

S M T W T F S
123 4567
89 1011121314
15 161718192021
22 232425 262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Powered by Dreamwidth Studios