#!/usr/bin/perl -- use strict; use warnings; close(STDIN); open( STDIN, '<', \my $stdin ) or die "$!\n$^E"; my $script_input = 'blah'; $stdin .= $script_input; while (<>) { print; }