Re: [Perl-unix-users] Strange behaviour in Perl

2006-01-27 Thread Arijit Das
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:---

RE: Strange behaviour in Perl

2006-01-25 Thread Brian Raven
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arijit Das Sent: 25 January 2006 11:47 To: activeperl@listserv.activestate.com; perl-unix-users@listserv.activestate.com Subject: Strange behaviour in Perl > I am just wondering why is this giving a strange result. Any cl

RE: Strange behaviour in Perl

2006-01-25 Thread Bowie Bailey
Arijit Das wrote: > I am just wondering why is this giving a strange result. Any clues...? > > $ echo 4.56 | perl -p -e 'my $var1 = ; $var2 = $var1 * 100; print $var2;' > 04.56 > $ > > I am expecting 456 in the ouput instead of 4.56 > > Am I missing anything...? The '-p' option is causing the

Re: Strange behaviour in Perl

2006-01-25 Thread DZ-Jay
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...? > Remov

Re: [Perl-unix-users] Strange behaviour in Perl

2006-01-25 Thread DZ-Jay
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 (<>) { .

RE: Strange behaviour in Perl

2006-01-25 Thread Joseph C. Bautista
I think the –p is the one causing the problem   Tried   echo 4.56 | perl -e 'my $var1 = * 100; print $var1;'   and the result is 456       bash-2.01$ echo 4.56 | perl -p -e 'my $var1 = ; $var2 = $var1 * 100;  print $var2;' 04.56     I only remove th

Re: Strange behaviour in Perl

2006-01-25 Thread Anthony R. Nemmer
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...? Thanks, Arijit

RE: Strange behaviour in Perl

2006-01-25 Thread Chris Newman
f Of Arijit Das Sent: Wednesday, January 25, 2006 5:47 AM To: activeperl@listserv.activestate.com; perl-unix-users@listserv.activestate.com Subject: Strange behaviour in Perl   I am just wondering why is this giving a strange result. Any clues...?   bash-2.01$ echo 4.56 | perl -p -e

Strange behaviour in Perl

2006-01-25 Thread Arijit Das
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