Does anyone have a good example? I am having trouble looping..
Thanks
Does anyone have a good example? I am having trouble looping..
Thanks
Something like this?
#!/usr/bin/perl
my $outfile = 'fruits.txt';
my @fruits = qw(apple banana orange);
open(OUT,">$outfile") or die $!;
foreach my $fruit (@fruits) {
printf OUT "$fruit\n";
}
close(OUT);