I have the following, which works:
my ($user);
# This isn't defined explicity in production code, I'm just doing it h
+ere to
# illustrate what I (could) get back.
$user->{'host'} = '*';
unless ($user->{'host'} > 1) {
my $hList = $user->{'host'};
delete $user->{'host'};
push @{$user->{'host'}}, $hList;
}
$user->{'host'} needs to be an array, even if it contains only one item. The code I have works, but gives out an error:
Can't use string ("*") as an ARRAY ref while "strict refs" in use at t
+est.pl line 16.
...which is understandable, since it's not an array, it's a string.
Can someone suggest a better snippet for what I'm doing? Do I need to create a temporary ref to test on?
Thanks.