Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Using system (); with Strawberry Perl

by hippo (Bishop)
on Nov 30, 2021 at 10:16 UTC ( #11139264=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using system (); with Strawberry Perl
in thread Using system (); with Strawberry Perl

While I understand your sentiment and have done similar myself there is an inherent need to realise that doing such is pure hackery. In this particular case hadrons is shelling out to perform things like rename, unlink and so on which is arguably more work (because of shell escapes, etc) than just running the Perl built-ins. It is also highly relevant that it is this practice of shelling out alone which has given hadrons such problems that they have needed to come here seeking advice in the first place.

But for a first try, it's often quicker to just calling wget than it is to install and use LWP::UserAgent.

Can't say I agree. If LWP isn't already installed you may as well do so now because you are going to need it sooner or later. It's also pretty simple to use. However, if even that is too much trouble, then consider HTTP::Tiny which is in core so you already have it.


🦛

  • Comment on Re^3: Using system (); with Strawberry Perl

Replies are listed 'Best First'.
Re^4: Using system (); with Strawberry Perl
by cavac (Priest) on Nov 30, 2021 at 10:35 UTC

    LWP/wget might not be the best example, i agree. (Although, unless something has changed in the last year or so, the installed LWP doesn't work by default because the ::https module is missing).

    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2022-05-20 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?