[ale] perl -e

Lists lists at serioustechnology.com
Wed May 7 13:33:25 EDT 2014


Thanks Ed, that was the ticket. A duh moment as I've used -- with things like rm, should have 'thunk' if it myself. 

Geoffrey Myers

> On May 7, 2014, at 10:05 AM, Ed Cashin <ecashin at noserose.net> wrote:
> 
> My perl is very rusty, but "--" is often a way to say, "I'm done with
> options.  Pass the rest through."
> 
> perl -e 'print $ARGV[0]' -- -f
> 
> ... prints "-f".
> 
>> On Wed, May 7, 2014 at 9:34 AM, Lists <lists at serioustechnology.com> wrote:
>> So, I've written a perl subroutine that uses getopts. I can call this
>> subroutine from a perl script fine. What is like to do is call it from a
>> shell script via 'perl -e'. I know I can pass parms to the subroutine as
>> such:
>> 
>> perl -e '...' Args here
>> 
>> And the routine will see them via ARGV. If I try to pass flags (-f) they are
>> apparently passed to perl rather than the module.
>> 
>> Solutions?
>> 
>> Geoffrey Myers
>> 
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
> 
> 
> 
> -- 
>  Ed Cashin <ecashin at noserose.net>
>  http://noserose.net/e/
>  http://www.coraid.com/
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20140507/ef27bfef/attachment.html>


More information about the Ale mailing list