On Thursday 09 October 2008, Charlie Farinella wrote:
> I have a string of text that I want to split on the tabs:
>
> while (<INFILE>) {
> my @array = split(/\t/, $_);
>
> ...manipulate them a little, and print them back out like so:
>
> print "$array[0],$array[1],$array[2]"; etc.
> }
>
> I normally just print them as above, but I'm thinking there must be a
> better way.
> What's the most efficient way to print them all out?
To answer my own question, it looks like
foreach $array (@array) {
print "$array,"
}
will work.
--
------------------------------------------------------------------------
Charles Farinella
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
voice: 603.924.6079 fax: 603.924.8668
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/