Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 chanting in the Monastery: (8)
As of 2014-07-23 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (153 votes), past polls