Looping backreferences
Joshua Goodall
joshua at roughtrade.net
Thu Aug 21 04:19:26 CDT 2003
On Thu, Aug 21, 2003 at 07:06:42PM +1000, Andrew Savige wrote:
> > We could try eliminating the join and the reverse:
> >
> > $net = "$+." x defined($3)."$2.$1"
> > if $zone =~ /^(\d+)\.(\d+)\.(?:(\d+)\.)?in-addr\.arpa$/;
>
> which can obviously be improved by fiddling with the parentheses:
>
> $net="$3$2.$1" if $zone=~/^(\d+)\.(\d+)\.((?:\d+\.)?)in-addr\.arpa$/;
>
> which is finally a one-liner. :-)
"... and then I shot him, your Honour."
:) nicely done!
J
--
Joshua Goodall "tea makes itself"
joshua at roughtrade.net - Ana Susanj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mail.pm.org/archives/melbourne-pm/attachments/20030821/0b0a7027/attachment.bin
More information about the Melbourne-pm
mailing list