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

Hi I understand what you are saying here...but my code works too.....hmm ... but the line print $logfh join(" ", map { sprintf "%7d" $_ } @x); is erroring out
  • Comment on Re: Re: efficient Array printing to a file

Replies are listed 'Best First'.
Re: Re: Re: efficient Array printing to a file
by Somni (Friar) on May 28, 2004 at 05:12 UTC
    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.

      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?