On 8/4/10 Wed  Aug 4, 2010  9:09 AM, "Sooraj S"
<[email protected]> scribbled:

> Hi,
> 
> My script has 3 options which recieve integers. If any of those
> options are having a value which is less than zero i want to make them
> to 100.
> 
> eg: if opt2 = 32 and opt3 = 24 i want to make them to 100.
> 
> code
> =====
> our $opt1,$opt2,$opt3;
> our @opt = (\$opt1,\$opt2,\$opt3);
> 
> GetOptions('opt1=i' => \$opt1,
>            'opt2=i' => \$opt2,
>            'opt3=i' => \$opt3)
> check();
> 
> sub check
> {
>   foreach (@opt)
>   {
>     # error here : The change does not get reflected on the actual
> options.
>     if ($$_ < 100)
>     {
>       $$_ = 100;
>     }
>   }
> }
> 
> 
> Pls help me..

Your program as shown above does not compile. There are at least three
errors. When I fix those errors, the program works on my system (perl
5.10.1). Can you post the exact program you are trying to run, the command
line you use to run the program, your results, and the version of perl and
any modules you are trying to use? Thanks.



-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to