open F, "cat file | /usr/bin/mycommand"; my $def_slash = $/; $/ = ""; eval ; $/ = $def_slash; close F;