#!/usr/bin/perl use strict; use warnings; my $sh_script = do { local $/; }; my @args = ( 'option1' ); system(sh => (-c => $sh_script, '--', @args) ) == 0 or die "$?/$!\n"; __DATA__ #!/bin/sh echo "hello" echo $1 echo "hi"