This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove stale code from Thread.xs.
[perl5.git] / lib / dotsh.pl
index 4db85e7..877467e 100644 (file)
@@ -53,13 +53,13 @@ sub dotsh {
    open (_SH_ENV, "/tmp/_sh_env$$") || die "Could not open /tmp/_sh_env$$!\n";
    while (<_SH_ENV>) {
        chop;
-       /=/;
-       $ENV{$`} = $';
+       m/^([^=]*)=(.*)/s;
+       $ENV{$1} = $2;
    }
    close (_SH_ENV);
    system "rm -f /tmp/_sh_env$$";
 
-   foreach $key (keys(ENV)) {
+   foreach $key (keys(%ENV)) {
        $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
    }
    eval $tmp;