>> Does anyone know why this doesn't do what I expect?
>>
>> % perl -e '$i="123.52.32.1"; $j=45; $b="$i_".$j*2; print $b, "\n";'
>> 90
>
> perl does. Try turning on warnings.
>
>> I'd like it to print: 123.52.32.1_90
>>
>> What's going on here?
>
> You need something like
>
> $b="${i}_".$j*2;
>
> otherwise you are trying to access $i_
Interesting! It seems like I do things like this all the time... How does
perl decide where the variable ends and the quoted text begins?
Thanks, everyone.
- Bryan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>