Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: perl script inside a shell script

by chipmunk (Parson)
on Dec 12, 2000 at 03:17 UTC ( [id://46178]=note: print w/replies, xml ) Need Help??


in reply to Re: perl script inside a shell script
in thread perl script inside a shell script

Very nice! As another way of doing it, using quotes around the here-doc terminator saves you from having to backslash all those special characters.
#!/bin/sh echo This is bash i=12 echo $i perl - $i <<'__HERE__' my $i = shift; print "This is perl\n"; print ++$i . "\n"; __HERE__ echo This is bash again echo $i
Because << is a redirection to STDIN, in order to add $i to the command line I also had to add - so that perl would know to read the script from STDIN.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://46178]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-09-15 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (21 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.