in reply to Did I get what I expected (an array)?

There's is essentially no difference between returning a one element list and a single scalar. However if you're returning an array (not list) and assigning to a scalar you'll get the length of the list (as opposed to the first element when returning a list). This is all do with the context in which the sub is called, so maybe you could take advantage of context e.g
use strict ; use warnings ; sub test { return wantarray ? qw(test) : scalar @{[qw(test)]}; } my $test = test() ; my @test = test() ; print ">>> $test\n" ; print map "[$_]\n",@test ; print $test == scalar(@test)? "Yepa!\n" : "Nope!\n" ; __output__ >>> 1 [test] Yepa!
If you ever start using modules for this sort of thing I highly recommend any of the Test modules and for context issues the marvellous Want.
HTH

_________
broquaint