#! /usr/bin/perl use strict; use warnings; sub bla { local $\ = local $, = $/; local $" = "X"; print "@_"; } my @array = 1..5; my $from_here; bla <<"END_HERE"; first try: @array END_HERE # vs. { local $" = $/; bla <<"END_HERE"; second try: @array END_HERE } # vs. bla "third try: ", @array;