You can 'reset' an array like so:
@arr = ();
But you don't need to do that to get your code to work:
use strict; # ALWAYS!!!
my @array = &getarray();
my $blah;
foreach my $val (@array) {
$blah .= ",$val";
}
print "$blah\n";
sub getarray {
return ('a'..'d');
}
Also, don't forget about
join which will replace the
for loop and concatention for you (and do a much better
job anyway):
print join(',', getarray()), "\n";
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)