Shevek wrote:
Surely wossname has to be criterion wossname mumble foo. Maintailability.
maintailability: the aspect of software causing a long tail of
maintenance programmers to pore over it.
-Dom
--
| Semantico: creators of major online resources |
| URL: http://www.semantico.
On Wed, 5 Feb 2003, Graham Barr wrote:
> On Wed, Feb 05, 2003 at 08:27:08AM -0800, Randal L. Schwartz wrote:
> > > "Jasper" == Jasper McCrea <[EMAIL PROTECTED]> writes:
> >
> > Jasper> $h = { $_ => $h || {} } for reverse @r;
>
>
> And that could be done as
>
> $h = reduce {{$b,$a}} {}, r
On Wed, Feb 05, 2003 at 08:27:08AM -0800, Randal L. Schwartz wrote:
> > "Jasper" == Jasper McCrea <[EMAIL PROTECTED]> writes:
>
> Jasper> $h = { $_ => $h || {} } for reverse @r;
And that could be done as
$h = reduce {{$b,$a}} {}, reverse @r;
using List::Util, if it did not trigger a bug
"Randal L. Schwartz" wrote:
>
> > "Jasper" == Jasper McCrea <[EMAIL PROTECTED]> writes:
>
> Jasper> $h = { $_ => $h || {} } for reverse @r;
>
> Autovivification makes the "|| {}" mostly unnecessary.
OH YEAH!!! WELL FU^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H
Paul's answer gave me the impression
> "Jasper" == Jasper McCrea <[EMAIL PROTECTED]> writes:
Jasper> $h = { $_ => $h || {} } for reverse @r;
Autovivification makes the "|| {}" mostly unnecessary.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn
> "Paul" == Paul Makepeace <[EMAIL PROTECTED]> writes:
Paul> On Wed, Feb 05, 2003 at 09:53:28AM +, Roger Burton West wrote:
>> On Wed, Feb 05, 2003 at 01:31:21AM -0800, Randy J. Ray wrote:
>> >$s = $r;
>> >for (@list) { $s = $s->{$_}; last unless ref $s; }
>> >There's probably a trickier,
On Wed, Feb 05, 2003 at 09:53:28AM +, Roger Burton West wrote:
> On Wed, Feb 05, 2003 at 01:31:21AM -0800, Randy J. Ray wrote:
> >$s = $r;
> >for (@list) { $s = $s->{$_}; last unless ref $s; }
> >There's probably a trickier, shorter "golf" solution, but I was never into
> >obfuscated code writ
Paul Makepeace wrote:
>
> On Wed, Feb 05, 2003 at 08:57:24AM +, Roger Burton West wrote:
> > I have a list of elements of arbitrary length: qw(foo bar baz qux). I
> > want to convert this into a deep hash reference:
> >
> > $r->{foo}{bar}{baz}{qux}
> >
> > Any easy way of doing this?
>
> $ pe
On Wed, Feb 05, 2003 at 11:49:51AM +, Tim Sweetman said:
> *cough* premature optimisation *cough* ...
Apparently reciting the times table or trying to remember all the FA Cup
winners since the war really helps this.
HTH, HAND
Simon
Joel Bernstein wrote:
>
> On Wed, Feb 05, 2003 at 09:53:28AM +, Roger Burton West wrote:
> > On Wed, Feb 05, 2003 at 01:31:21AM -0800, Randy J. Ray wrote:
> > >$s = $r;
> > >for (@list) { $s = $s->{$_}; last unless ref $s; }
> > >There's probably a trickier, shorter "golf" solution, but I was
On Wed, Feb 05, 2003 at 09:53:28AM +, Roger Burton West wrote:
> On Wed, Feb 05, 2003 at 01:31:21AM -0800, Randy J. Ray wrote:
> >$s = $r;
> >for (@list) { $s = $s->{$_}; last unless ref $s; }
> >There's probably a trickier, shorter "golf" solution, but I was never into
> >obfuscated code writ
On Wed, Feb 05, 2003 at 01:31:21AM -0800, Randy J. Ray wrote:
>$s = $r;
>for (@list) { $s = $s->{$_}; last unless ref $s; }
>There's probably a trickier, shorter "golf" solution, but I was never into
>obfuscated code writing...
That makes sense; I was looking for a single-step transformation...
On 2003.02.05 00:57 Roger Burton West wrote:
I have a list of elements of arbitrary length: qw(foo bar baz qux). I
want to convert this into a deep hash reference:
$r->{foo}{bar}{baz}{qux}
Any easy way of doing this?
$s = $r;
for (@list) { $s = $s->{$_}; last unless ref $s; }
There's probably
On Wed, Feb 05, 2003 at 08:57:24AM +, Roger Burton West wrote:
> I have a list of elements of arbitrary length: qw(foo bar baz qux). I
> want to convert this into a deep hash reference:
>
> $r->{foo}{bar}{baz}{qux}
>
> Any easy way of doing this?
$ perl -MData::Dumper -le '
@r=qw(foo bar baz
I have a list of elements of arbitrary length: qw(foo bar baz qux). I
want to convert this into a deep hash reference:
$r->{foo}{bar}{baz}{qux}
Any easy way of doing this?
Roger
15 matches
Mail list logo