use IO::File; my $file; { ## this trick is known as file slurping local $/; my $fh = IO::File->new("lextut1.pl") or die("ack: $!"); $file = <$fh>; } print $file; my @foo = qw( a comma separated list of words ); { local $" = ', '; print "@foo\n" } __output__ my $foo = "in the lextut1.pl's lexical file scope"; print "\$foo is: ", (defined $foo ? $foo : "undefined"), $/; a, comma, separated, list, of, words