replace this: open STUFF, '<', './mystuff' or die "Can't open './mystuff' for input:\n$!"; local $/; my $stuff = ; close STUFF; with this: my $stuff < io './mystuff';