in reply to Re: a hash/array problem and can contents of an array be printed as one line
in thread a hash/array problem and can contents of an array be printed as one line

If everytime you open the file you split by /, / and then print using:
# write file delimited by comma space (even last item) foreach $data (@vals) { print OUTFILE "$data, "; } print OUTFILE "\n";
You will end up with a file with lots of trailing commas.
Instead of the loop, you can use:
print OUTFILE join(', ', @vals) . "\n";

Hope this helps
Aziz,,,

Replies are listed 'Best First'.
Re: Re: Re: a hash/array problem and can contents of an array be printed as one line
by synapse0 (Pilgrim) on Jul 16, 2001 at 03:34 UTC
    The original post had the commas (explicitly put in there by the code he wrote) at the end of the lines... Instead of changing his file formats, I just used the format that was stated.
    -Syn0