my $foo= 'Now is the time for all good men to come to the aid of their country'; { local $\ = " "; local $/ = \5; $foo =~ tr/ //d; open my $fh, '<', \$foo; print uc while <$fh>; }