LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] OT Perl question

[ILUG] OT Perl question

Hunt, Bryan B.Hunt at emuse-tech.com
Wed Mar 20 15:19:41 GMT 2002


Here's the wierd thing though it works anyhow and isn't flagged as a problem
when using just -w switch (im using "use diagnostics" ). 

--B

-----Original Message-----
From: Ronan Waide [mailto:waider at waider.ie]
Sent: 20 March 2002 15:05
To: Hunt, Bryan
Cc: Ilug (E-mail)
Subject: RE: [ILUG] OT Perl question


On March 20, B.Hunt at emuse-tech.com said:
> The message isn't particularly meaningful but here it is. 
> 
> <whiney-message>
> Reference found where even-sized list expected at ./funnel.pl line 12 (#2)
>  
>     (W misc) You gave a single reference where Perl was expecting a list
> with
>     an even number of elements (for assignment to a hash). This
>     usually means that you used the anon hash constructor when you meant
>     to use parens. In any case, a hash requires key/value pairs.
>  
>         %hash = { one => 1, two => 2, };        # WRONG
>         %hash = [ qw/ an anon array / ];        # WRONG
>         %hash = ( one => 1, two => 2, );        # right
>         %hash = qw( one 1 two 2 );                      # also fine
>  
> Reference found where even-sized list expected at ./funnel.pl line 13 (#2)
> </whiney-message>
> 
> --B

Seems pretty explicit: you've given it a reference where it expected a
hash. %{users} isn't a hash. %{$users} might be, though. If you had
used perl -w, it would have flagged "users" as a bareword. This is why
the manual keeps telling you to use -w.

Cheers,
Waider.
-- 
waider at waider.ie / Yes, it /is/ very personal of me.

buzzard says, "If you are willing to put aside your kneejerk human
speciesism,
    the AIs are perfectly sympathetically 'no worse' than humans." <matrix>




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell