[EMAIL PROTECTED] wrote:
> 
> Can someone please explain why this
> 
>  while (1) {
>            my $item = <STDIN>;
>            chomp $item;
>            last unless $item;

You should use a different test then true or false for $item

             last unless length $item;


>            $inventory{1c $item}++;

It looks like you intended to use the lc (ell-cee) operator but have
used the string '1c' (one-cee) instead.

             $inventory{lc $item}++;


> }
> 
> Gets Bare word  found where operator expected
> Syntax error line 13 near 1c

Why not just loop on <STDIN> instead of using an infinite loop?

while ( <STDIN> ) {
    chomp;
    last unless length;
    $inventory{ lc() }++;
    }



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to