http://qs1969.pair.com?node_id=11139264


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";'