in reply to Re: Re: efficient Array printing to a file
in thread efficient Array printing to a file

print $logfh join(" ", map { sprintf "%7d", $_ } @x)

Note the comma after sprintf's format and $_. It was not in my original code. Also, that does not print a newline, which may be important.

Replies are listed 'Best First'.
Re: Re: Re: Re: efficient Array printing to a file
by Anonymous Monk on May 29, 2004 at 01:35 UTC
    Hi again, What am i doing wrong here?? print FILE join(" ", map { sprintf "%7d", $_ } @x);

      The code is syntactically correct. What are you expecting? What do you get? Recall I mentioned it doesn't print a newline, are you expecting it to?

        Hi there I am not expecting it to print a new line. if thie were an array @x = 123456 I want the output to a file to look like this (without a newline.) 1 2 3 4 5 6