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: Mike Schwartz
Date:  
To: Main PLUG discussion list
CC: Vaughn Treude, Mike L Schwartz
Subject: Re: Perl question: passing in variables
On 7/6/07, 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
>


I do not know Perl,
but maybe if you find a perl FAQ on the web,
you can search for something about a
"persistent variable"
or s. like that... if that's what it is.
Just a guess, from
--
Mike Schwartz
Glendale AZ


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