Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: RFC Using PERL HEREDOC script within bash

by sundialsvc4 (Abbot)
on Aug 27, 2014 at 15:22 UTC ( #1098762=note: print w/replies, xml ) Need Help??


in reply to RFC Using PERL HEREDOC script within bash

“Clever” though it might seem to you, if I were your manager or team-lead and I saw nonsense (ahem ...) like this in any source-repository that I was responsible for, “I’d kick your a*s right down the river and order you to rewrite it immediately.”   And, believe me, I’d circle back to see that it had actually been done, and that nothing of this sort ever showed-up again.

“Not on my watch, you don’t!!”

Just sayin’ ...

If you want to do stuff like that, use Perl.   There’s zero reason to use Bash Scripting, which was never intended to be a real scripting-language anyway, in order to invoke something that is, and to do it in a nonsensical way.   Use Perl, and put #/usr/bin/perl right there on the “shebang” line.

  • Comment on Re: RFC Using PERL HEREDOC script within bash

Replies are listed 'Best First'.
Re^2: RFC Using PERL HEREDOC script within bash
by oiskuu (Hermit) on Aug 29, 2014 at 10:22 UTC

    Sir, your wisdom appears to contradict wikipedia, that specifically says this about Bourne shell (precursor to bash):

    Although it is used as an interactive command interpreter, it was also intended as a scripting language and contains most of the features that are commonly considered to produce structured programs.
    A reference is made to an article, and from this I again quote:
    The primary problem was to design the shell be a fully programmable scripting language that could also serve as the interface to users typing commands interactively at a terminal.

    Now the history and evolution of shells is quite an interesting topic. Please do not hesitate in providing references, should you be aware of any well-researched works on this subject matter.

    ps. Your exposition has vaguely reminded me of a magnificent oeuvre in quite a different field. Thoroughly recommendable, this.
Re^2: RFC Using PERL HEREDOC script within bash
by dcronin135 (Acolyte) on Aug 27, 2014 at 16:44 UTC

    No need for the nasty gram. Either use or don't use it. The submission was in response to others asking the question. Simply offers a method illustration, nothing more. And yes each shop has its coding conduct, no contest there.

Re^2: RFC Using PERL HEREDOC script within bash
by Anonymous Monk on Aug 27, 2014 at 19:27 UTC
    put #/usr/bin/perl right there on the “shebang” line

    I think #!/usr/bin/perl will work better...

Re^2: RFC Using PERL HEREDOC script within bash
by marto (Archbishop) on Aug 29, 2014 at 09:33 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2019-10-21 18:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?