in reply to Concatenate printing a string and array

Try this:
@array = (1,2,3,4,5); local $"= ""; print "Your result is @array";
I am not sure how using output list separator ($") is going to affect the rest of your program
That is why i've put it local (assuming u r using a subroutine).
Raghu

Replies are listed 'Best First'.
Re^2: Concatenate printing a string and array
by johngg (Canon) on Jan 05, 2009 at 11:49 UTC
    I am not sure how using output list separator ($") is going to affect the rest of your program That is why i've put it local (assuming u r using a subroutine).

    It is better to limit the scope of the change using a bare code BLOCK

    { local $" = q{}; print qq{@array}; }

    or a do BLOCK

    print do{ local $" = q{}; qq{@array} };

    I hope this is useful.

    Cheers,

    JohnGG