Thanks a lot folks. My mistake...I should have looked at "-p"'s significance before posting it. Thanks again, ArijitDZ-Jay <[EMAIL PROTECTED]> wrote: Arijit Das wrote:> I am just wondering why is this giving a strange result. Any clues...?> This is from the Perl In A Nutshell book:---
Arijit Das wrote:
I am just wondering why is this giving a strange result. Any clues...?
This is from the Perl In A Nutshell book:
--
-p: Causes Perl to assume the following loop around your script, which
makes it iterate over filename arguments:
LINE:
while (<>) {
.
Arijit Das wrote:
> I am just wondering why is this giving a strange result. Any clues...?
>
> bash-2.01$ echo 4.56 | perl -p -e 'my $var1 = ; $var2 = $var1 *
> 100; print $var2;'
> 04.56
> bash-2.01$
>
> I am expecting 456 in the ouput instead of 4.56
>
> Am I missing anything...?
Try it
I am just wondering why is this giving a strange result. Any clues...? bash-2.01$ echo 4.56 | perl -p -e 'my $var1 = ; $var2 = $var1 * 100; print $var2;'04.56bash-2.01$ I am expecting 456 in the ouput instead of 4.56 Am I missing anything...? Thanks,Arijit
Do you Yahoo!?
With