in reply to hash of hashes

As others have stated, it is unclear what you want here. Your title and text seem to have no relationship to each other. Please read the guidelines in "How do I post a question effectively?" and follow them before posting again.

My best guess at what you're after:

#!/usr/bin/env perl -l use strict; use warnings; my @x = qw{X A B}; my $x = shift @x; my @y = map { [ $_ ] } @x; push @$_, $x for @y; print join ',' => map { "@$_" } @y;

Output:

A X,B X

-- Ken

Replies are listed 'Best First'.
Re^2: hash of hashes
by Laurent_R (Canon) on Oct 05, 2013 at 10:03 UTC

    Or, perhaps a simpler alternative demonstrated under the Perl debugger:

    DB<1> @x = qw{X A B}; DB<2> $x = shift @x; DB<3> print map {" $_ $x,"} @x; A X, B X,