[prog] perl woes...

Dan Richter daniel.richter at wimba.com
Mon Jun 2 14:00:15 EST 2003


>         => is pronounced "fat comma" in Perl.  It's syntatically the
>same as "," except that Perl assumes that you intended the quote the
>single last word to the left of the comma if it's currently a bareword.

I'm another programmer who's learning Perl and who has recently found this 
operator intriguing. I've learned that Perl passes hashes (dictionaries) as 
a flat list: key, value, key, value, ... So you can do this:

   sub Foo {
     my %hash = @_;     # all arguments passed
     ..
   }

   Foo( a=>'b', x=>'y' );

As Jacinta pointed out, that is exactly the same as writing this:

   Foo('a','b','x','y');

But there's an obvious difference to the reader.

========== Dan Richter ============== mailto:Dan at wimba.com ===========
   When a program dies / what you need is a moment / of serenity.
       - Damian Conway, whose Perl module transforms computer
         error messages into haikus.



More information about the Programming mailing list