OK, one more question: How do you guys recommend that I flatten lists? I mean... say I have some values in an array, or in two arrays and I want to turn it into one flat list that will not have any array-specific or similar behavior.
You flatten lists like this:
my @newarray = @oldarray; my @newarray = (@oldarray1, @oldarray2); my @newarray = (@oldarray, 2, 3, qw( foo bar baz ) );
But your question doesn't make a lot of sense. You seem to be asking "How do I make an array that isn't an array", and the answer to that is "You can't".
If you're trying to ask "How do I return different values from a function depending on the calling context", then look into wantarray as shmem suggests.
In reply to Re^2: regexp list return 5.6 vs 5.8
by mrpeabody
in thread regexp list return 5.6 vs 5.8
by Sixtease
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |