in reply to One-liner to join keys on a two-dimensionnal hash ?
Close.
my $expr = join '|', map { keys( %{ $replaces{$_} } ) } keys( %replaces );
With foreach:
my @keys; for ( keys( %replaces ) ) { push @keys, keys( %{ $replaces{$_} } ); } my $expr = join '|', @keys;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: One-liner to join keys on a two-dimensionnal hash ?
by Anonymous Monk on Dec 29, 2021 at 15:01 UTC | |
by ikegami (Patriarch) on Dec 29, 2021 at 15:07 UTC | |
by eyepopslikeamosquito (Archbishop) on Dec 29, 2021 at 23:20 UTC |
In Section
Seekers of Perl Wisdom