in reply to Re: regexp list return 5.6 vs 5.8
in thread regexp list return 5.6 vs 5.8
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: regexp list return 5.6 vs 5.8
by almut (Canon) on Jan 25, 2008 at 06:03 UTC |
In Section
Seekers of Perl Wisdom