Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: help declaring variables within perl one-liner

by perlfan (Vicar)
on Apr 02, 2021 at 05:45 UTC ( [id://11130701]=note: print w/replies, xml ) Need Help??


in reply to Re: help declaring variables within perl one-liner
in thread help declaring variables within perl one-liner

>perl one-liners scripts called from another perl script

One liners are bad enough; but I swear, "shelling-out" to actual Perl scripts from a Perl script is one of the most offensive things I can see in Perl code. All the wasted cycles, dead electrons, PIDs, (oh the horror!) and server fan RPMs that are consumed for no reason ... incidentally in most (but not all) a simple conversion of the called script to a modulino would; then using it as a library rather than a system call would fix all of that. The only exception I've run across is if the called Perl script is specifically being used for sandboxing necessary privilege escallation; in that case, I think it's fine to treat the Perl script as an opaque userland program.

  • Comment on Re^2: help declaring variables within perl one-liner

Replies are listed 'Best First'.
Re^3: help declaring variables within perl one-liner
by haukex (Archbishop) on Apr 02, 2021 at 08:48 UTC
    One liners are bad enough; but I swear, "shelling-out" to actual Perl scripts from a Perl script is one of the most offensive things I can see in Perl code.

    My opinion is actually the other way around: system, when used properly, is less bad than using qx//, because the latter almost always involves the shell and introduces quoting problems - though what I said above still stands, calling another perl is almost never necessary (the most common exception I make is during testing). See Calling External Commands More Safely and The problem of "the" default shell.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 13:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found