in reply to Text::Unaccent::PurePerl undef values
With 5.10+, you can use the defined-or operator:
In older Perls, you need to be more verbose:@$ResultsFinal = sort { unac_string($a->[$OptOrderToDisplayTable] // " +") cmp unac_string($b->[$OptOrderToDisplayTable] // " +") } @$ResultsFinal );
unac_string( defined $a->[$OptOrderToDisplayTable] ? +$a->[$OptOrderToDisplayTable] : "")
Update: Fixed the code. If you had provided SSCCE, I could've tested my code :-)
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Text::Unaccent::PurePerl undef values
by IB2017 (Pilgrim) on Mar 18, 2018 at 22:22 UTC | |
by choroba (Cardinal) on Mar 18, 2018 at 22:48 UTC | |
Re^2: Text::Unaccent::PurePerl undef values
by IB2017 (Pilgrim) on Mar 18, 2018 at 23:13 UTC |
In Section
Seekers of Perl Wisdom