Hello William,

On Mon, 12 Sep 2011 20:05:38 -0700 (PDT)
William <lilijr...@gmail.com> wrote:

> My Code:
> use strict ;
> use warnings ;
> 
> chomp($input = <STDIN>) ;
> 
> I compile this but has a error. say:Globla symbol "@input" requires
> explicit package name at...

Well, you didn't copy-and-paste the error correctly, but I recognise it. This
is an anachronistic error (and unfortunately very common) that means that you
should declare your variables using "my":

        chomp(my $input = <STDIN>);

For more information see:

http://perl.plover.com/FAQs/Namespaces.html

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://shlom.in/sussman

I may be a geek, but I’m a true Klingon geek‐warrior! And a true Klingon geek
warrior ALWAYS bottom‐posts.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to