o.k. here is another one:
I still have a text file I am trying to get into a csv line, for example:
cheese olives beans carrots
So I put this into an array like:
my @headers = split /\s+/;
But now I want to print this in csv format:
"cheese","olives","beans","carrots".
My best results have been to use:
foreach (@headers) {
print "\"$_\",";
}
But I am sure there is a better way, for example can I define the '$,'
variable to be a comma? I have searched all my documentation and haven't
come to any solid conclusion.
Secondly, I find that I get a zero-length field for $headers[0] and don't
understand why.
Lastly, does /\s+/ mean 2 or more spaces or does it mean one or more spaces,
I imagine that \s counts for one space and the '+' counts for one or more
'other' spaces - is this correct (i.e. I don't need /\s\s+/ to find two or
more spaces).
Laters,
Tim
____________________________________________________
Timothy B Booher, Lt USAF, AFRL/MNAC
101 West Eglin Blvd, Suite 339
Eglin AFB FL 32542-6810
Phone: 850-882-8302 Ext. 3360 (DSN 872-)
FAX: 850-882-2201