I'm having a mental block and hoping someone can help me out. I have the following data structure (an array of anonymous hashes with a named hash inside each anonymous hash):
[ { '221479714642518' => { 'name' => 'Family Mobile Phone and Ta +blet Repair', 'link' => 'https://www.facebook.com/F +amilyMobileRepairs/' } }, { '1626748754240747' => { 'name' => 'Bows and Baubles by Morga +n', 'link' => 'https://www.facebook.com/ +bowsandbaublesbymorgan/' } } ];
I want to sort the array based on the name key inside the inner hash. I'm trying something like this:
my @sorted_places = sort { $places->$a->{name} cmp $places->$b->{name} + } map { keys %$_ } @$places;
I get an error:
Can't call method "221479714642518" on unblessed referenceI've tried several different things but no luck. Any help is appreciated.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |