in reply to Re^2: Make CSV list from values in AoH
in thread Make CSV list from values in AoH

Your approach is not advisable.

Just imagine you need to change the quote from ' to ", then you'll have to change 4 code places instead of 2.

depends what "if there are no names" means.

map{ $AoH[$_]{name} || "" } should cover all cases except if the name "0" is not allowed (untested)

good night! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^4: Make CSV list from values in AoH
by tel2 (Pilgrim) on Aug 17, 2018 at 23:40 UTC
    Thanks Rolf.

    Good point - sorry for the ambiguity.  Basically meant the key "name" is missing.  Actually, the @AoH will be empty to there won't be any keys. I'm not sure how I can use:

    map{ $AoH$_{name} || "" }
    in context.  Is that what you meant by merging the two maps into one?

    But I'm pretty happy with the other stuff you've given me, thanks for your help.  Good morning...from NZ.