Re: Perl question: passing in variables

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: JD Austin
Date:  
To: Main PLUG discussion list
Subject: Re: Perl question: passing in variables
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 -
> 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:
http://www.twingeckos.com
phone/fax: 480.288.8195

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss