Hi There, :)
Why not do it this way?
#!/usr/bin/perl
my $script =<<EOT;
#!/bin/sh
echo "hello"
echo \$1
echo "hi"
EOT
system("echo \"$script\" > script.sh");
system("./script.sh", "world?");
Maybe that's too bashy to be considered perl? :D
Respectfully,
Brother Hippsta