Update:
depending on what the query returns, it's either a string or an array. I need to act on what's given.
In that case, you can use ref to figure out what you have:
my $thing = function_that_returns_arrayref_or_string; if( ref $thing eq 'ARRAY' ) { $user->{host} = $thing; } else { $user->{host} = [ $thing ]; }
In reply to Re: String or array?
by friedo
in thread String or array?
by sschneid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |