--- "McCormick, Rob E" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to understand an example from the Waite Press book (Perl 5
> Interactive Course, a bit dated, '97, Orwant) The example doesn't
> have -w or strict; enabled. I ran it with them and the error
follows:
>
> #!c:/perl/bin/perl -w
> u
E [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 25, 2001 5:47 PM
> To: '[EMAIL PROTECTED]'
> Subject: void context, looping example
>
>
>
> I'm trying to understand an example from the Waite Press book (Perl 5
> Interactive Course, a bit dated, '97
The void context means that you're doing something that does nothing useful.
$num * 3;
Takes the value of $num, multiplies it by 3 and then trows the result
away, leaving $num unchanged. I think you want *= like this:
use strict;
print "Please type an integer: ";
chomp( my $num = );
while(
I'm trying to understand an example from the Waite Press book (Perl 5
Interactive Course, a bit dated, '97, Orwant) The example doesn't have -w
or strict; enabled. I ran it with them and the error follows:
#!c:/perl/bin/perl -w
use strict;
print "Please type an integer: ";
chomp ( my $num = )