in reply to Joining if an array
I might be tempted to use the ternery operator, but usually for a non-trivial assignment (like a join) I'd avoid it as it just gets messy. I'd probably do:
Not short, but pretty clear in what I mean (hopefully).my $in; if (ref $scalar eq 'ARRAY') { $in = join(",",@$scalar); } else { $in = $scalar; }
In Section
Seekers of Perl Wisdom