In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Bryan Harris) writes:
>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
>
>I'd like it to print:  123.52.32.1_90
>
>What's going on here?

If a one-liner doesn't do what you expect, take advantage of
strict and warnings to get Perl to tell you what's going on:

% perl -Mstrict -we 'my $i="123.52.32.1"; my $j=45; my $b="$i_".$j*2; print $b, "\n";'
Global symbol "$i_" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to