zli034 has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys, this's just a obvious question, I be pleased if anyone can make this code better for me.
sub return_string{ my @temp = (12,23,34,4,5); my $seq; foreach my $key(@temp){ $seq = $seq.$key.','; } return substr($seq, 0, -1); }
This's just an arry, I want to return it as comma seperated string.
must be quicker way to do it
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Return a comma seperate array
by FunkyMonk (Bishop) on Feb 19, 2008 at 23:23 UTC | |
|
Re: Return a comma seperate array
by runrig (Abbot) on Feb 19, 2008 at 23:22 UTC | |
|
Re: Return a comma seperate array
by lodin (Hermit) on Feb 19, 2008 at 23:58 UTC |