Printing Mutliple Fields from Split
Posted on 2003-10-23
This is not a homework assignment.
I have the following statements within a script:
@fields=split /\s+/,$line; ; #Split the line at semicolons
print FH "$fields\n"; #Print the first field
How is it that I would alter the print statment so that it prints multiple fields. I tried the following but they failed:
print FH "$fields[0,2] \n"; #Print the first field
print FH "$fields[0...5] \n"; #Print the first field
Thanks for your help.