SPUG: Readable, well-written code (was: Best One-Liners and Scripts for UNIX)

Brian Hatch spug at ifokr.org
Sun Apr 20 23:52:29 CDT 2003



You can't tell me that this part of your code:

> @doubled = map { ($x = $_) =~ s/(\d+)/$1 * 2/e;
                   ^^^^^^^^^

won't confuse and scare new users more than 'grep'
would.  Assignment in parens on the left of a s// ?
Now that's just substituting a not-immediately-obvious
grep feature with something that requires detailed
knowledge of the order of operations/precedence.


TMTOWTDIC

(There's more than one way to do it confusingly)


--
Brian Hatch                  "Don't use color
   Systems and                unless you mean it."
   Security Engineer          --Steve Jobs
http://www.ifokr.org/bri/

Every message PGP signed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030420/9a639d36/attachment.bin


More information about the spug-list mailing list