in reply to Re: Newbie question No.2
in thread Newbie question No.2

an even easier way is to set $"=" ", which is the "list separator" (i.e. what character to use when a list is printed inside double quotes)
$"=" "; @list = qw/The quick brown fox/; print "@list\n";

thor

Replies are listed 'Best First'.
Re: Modifying List Separator
by tadman (Prior) on Jun 10, 2002 at 14:00 UTC
    The capital E Easier way is to join, just as yodabjorn suggested. If you go mucking about with $", you're liable to break things, due to the fact that $" is a global variable. Since that's like changing the value of pi, which would cause bridges to fall down, and dams to burst, somewhere else in that program there may be a piece of code that expects the default behavior and it won't work properly any more. join, of course, has no such "action at a distance".

    If you absolutely must do this, declare your $" to be local:
    local $" = " ";