open( SH, "| /path/to/bash" ) or die "Can't open a shell: $!"; my @scripts; { local $/ = undef; for my $file ( "first_shell_script", "second_shell_script" ) { open( SCR, $file ) or die "couldn't read $file: $!"; push @scripts, ; close SCR; } } print SH $scripts[0]; print SH $scripts[1]; # and then do whatever magical stuff this shell can do, # now that it has these scripts in its arsenal...