Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Qiang's scratchpad

by Qiang (Friar)
on Jun 01, 2004 at 17:10 UTC ( #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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2016-06-30 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (403 votes). Check out past polls.