develooper Front page | perl.fwp | Postings from May 2003

Re: 99 bottles of beer on the wall

From:
Peter Makholm
Date:
May 25, 2003 00:36
Subject:
Re: 99 bottles of beer on the wall
Message ID:
87he7ja36o.fsf@xyzzy.adsl.dk
Andrew Savige <ajsavige@yahoo.com.au> writes:

> OK, I give up, what the hell is this?  $n!=1&&s=>
> Deparse says it is equivalent to:      $n!=1&&'s'

`perldoc perlop` says:

   The => digraph is mostly just a synonym for the comma operator.  It's
   useful for documenting arguments that come in pairs.  As of release
   5.001, it also forces any word to the left of it to be interpreted as a
   string.

So it's just used as an obscure way to stringify the s.

But why is it used? If it not just for the obfuscation my only guess
is that it makes it possible to do on the command line without having
to escape a pair of quotes.

-- 
 Peter Makholm     |         Perhaps that late-night surfing is not such a
 peter@makholm.net |           waste of time after all: it is just the web
 http://hacking.dk |                                              dreaming
                   |                                    -- Tim Berners-Lee



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About