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 romping around the Monastery: (7)
As of 2024-04-19 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found