in reply to Re^4: Quote-like operators in a hash
in thread Quote-like operators in a hash

The difference is that print imparts a list context, but the dot operator creates a scalar context. Your sqlExecute() ends with "return @result". An array in a scalar context evaluates to the number of items in the array, but in a list context, it's all the elements of the array.

Update: Here are a couple ways to get what you want without three lines:

The first is better for print, but the second can be useful in other places where you want to interpolate a function call.

Replies are listed 'Best First'.
Re^6: Quote-like operators in a hash
by tux402 (Acolyte) on Jan 05, 2009 at 19:15 UTC
    Wow, that makes so much sense. Thank you! This is why I love perlmonks. Everyone is so helpful and friendly.
Re^6: Quote-like operators in a hash
by wol (Hermit) on Jan 06, 2009 at 11:10 UTC
    So, in other words, the root answer is the same as for the previous question at the gates today: Concatenate printing a string and array

    Wow. Co-incidence? I think not - there's something afoot in 2009. I think we should expect many more arrays being concatenated with strings before the year is out...

    --
    use JAPH;
    print JAPH::asString();