use strict; use warnings; use Tie::Handle::FromArray; my $fh = new Tie::Handle::FromArray ( ["a","b"] ); while (<$fh>) { print "$_*"; } #### a*b*