use warnings; use strict; use IO::String; my $io = IO::String->new ("This is some text\nto be processed as\na file"); print while <$io>; #### This is some text to be processed as a file