Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Qiang's scratchpad

by Qiang (Friar)
on Jun 01, 2004 at 17:10 UTC ( [id://358262]=scratchpad: print w/replies, xml ) Need Help??

this is a copy & paste from hacker 's home node.
#!/usr/bin/perl
#
use strict;

my $x= <<EOF;
NAME='NBU 6.0 for Tru64 V5.1'
CODE=NBU
VERS=60
MI=NBU60.mi
ROOT=0
COMPRESS=1
RXMAKE=0
%%
YUNBU60 . 2 'NBU 6.0 (Tru64 V5.1)'

EOF

my $y = "echo '$x' > test";
run_me($y);

sub run_me { my $y=shift;`$y`}

running above gives me the error:
sh: -c: : syntax error near unexpected token `('
sh: -c: : `YUNBU60 . 2 'NBU 6.0 (Tru64 V5.1)''

## fixed with help from ambrus, thanks!
## he suggested puting the shell into another HERE doc then `` it. such as:

my $c = <<EOF;
echo "$k" > $pkg_k
EOF     
`$c`;


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2025-11-10 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (66 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.