Hi,
I want a variable created like so...
I thought there would be an easier way to create this so have tried
Plus countless variations, but I can't seem to work it out, is it possible using $_ in a compound expression like this?
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
I want a variable created like so...
Code:
# free slots holding hash
my $free_slots = {
'L' => {
'1' => {
'1' => 1,
'2' => 1,
'3' => 1,
'4' => 1,
'5' => 1
},
'2' => {
'1' => 1,
'2' => 1,
'3' => 1,
'4' => 1,
'5' => 1
}
},
'R' => {
'1' => {
'1' => 1,
'2' => 1,
'3' => 1,
'4' => 1,
'5' => 1
},
'2' => {
'1' => 1,
'2' => 1,
'3' => 1,
'4' => 1,
'5' => 1
},
'3' => {
'1' => 1,
'2' => 1,
'3' => 1,
'4' => 1,
'5' => 1
}
}
};
I thought there would be an easier way to create this so have tried
Code:
%free_slots = map {$_ => { map {$_ => {map {$_ => 1}[1,2,3,4,5]}}[1,2,3]}}['L','R'];
Plus countless variations, but I can't seem to work it out, is it possible using $_ in a compound expression like this?
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music