in reply to Re: variable sees it, array doesn't - stumped!
in thread variable sees it, array doesn't - stumped!

print (join ' ', @array), "\n";

...sadly, Perl's syntax will have you for breakfast here... the brackets will be interpreted as delimiting the parameters of the print "function" -- see perlfunc.

Replies are listed 'Best First'.
Re^3: variable sees it, array doesn't - stumped!
by DStaal (Chaplain) on Dec 31, 2008 at 18:56 UTC

    You are right: I thought I was using it someplace, but everywhere I've got it I put something else in before the output of the join.

    Either print((join ' ', @array), "\n"); or print (join(' ', @array)), "\n"; or even print join(' ', @array), "\n"; should work better.

      print (join(' ', @array)), "\n"
      Unfortunately, this one still doesn't work, for the same reason that print (join ' ', @array), "\n" doesn't. An option that I frequently use, though it feels dirty, is print '', (EXPR), "\n".