Perl question: passing in variables

JD Austin jd at twingeckos.com
Fri Jul 6 14:07:57 MST 2007


The values from the command line will be stored in the *|@ARGV|* array.
Likely won't have any impact on the value of foo :(
JD

Vaughn Treude wrote:
> Quick perl question:
> I'm trying to run a perl script that is executable; that is, the file 
> has "x" permission and starts with this line:
>
> #!/usr/bin/perl -w
>
> There's a parameter in this script that's not defined by default, for 
> example
>
> my $foo; # no default
>
> If foo is not set, the script exits with an error.  Normally I would 
> just modify the script but this script gets extracted from a shell 
> script that has the perl script and an rpm embedded in it.  (How they 
> did that I don't know.)  So I would expect there's a way to do this, but 
> there were  no help files with the script.
>
> The shell script invokes the install file like this:
> ./install_script *$
>
> So I know that I can pass one or more arguments to the outer shell 
> script and they will get passed verbatim to the perl script.
>
> Is there a to pass a value for foo into the script without modifying the 
> script?
>
> Thanks in advance,
> Vaughn
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>   


-- 
JD Austin
Twin Geckos Technology Services LLC
email: jd at twingeckos.com
http://www.twingeckos.com
phone/fax: 480.288.8195 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20070706/3cc79837/attachment.htm 


More information about the PLUG-discuss mailing list