in reply to Printing Array to a file

Alternately use the join function such as

print $fh join(":", @array);
or print a delimiter after each element (even after the last) of the array with a for loop like
print $fh $_, "\n" for @array;

Replies are listed 'Best First'.
Re^2: Printing Array to a file
by johngg (Canon) on Jan 27, 2010 at 11:15 UTC
    or print a delimiter after each element (even after the last) of the array with a for loop like

    You can still use the join idiom rather than choosing a loop.

    print $fh join qq{\n}, @array, q{};

    I hope this is of interest.

    Cheers,

    JohnGG