in reply to Modules to reduce syntax?
Util::H2O will take this,
And let you do this:my $ref = { foo => $bar => 'baz' }; printf "%s\n", $ref->{'foo'}{$bar};
If you use a lot hash references, it can remove a significant amount of typing and cruft simply by doing away with the curly braces. The reduction in typing and file size from these 2 characters quickly adds up. enjoy!use Util::H2O qw/h2o/; my $ref = h2o -recurse, { foo => $bar => 'herp' }; printf "%s\n", $ref->foo->$bar;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Modules to reduce syntax?
by LanX (Saint) on Dec 27, 2021 at 17:49 UTC | |
by perlfan (Vicar) on Dec 27, 2021 at 18:03 UTC | |
by LanX (Saint) on Dec 27, 2021 at 18:54 UTC | |
by perlfan (Vicar) on Dec 27, 2021 at 22:02 UTC | |
by LanX (Saint) on Dec 27, 2021 at 22:33 UTC |
In Section
Seekers of Perl Wisdom