peateasea,
@peateasea@mastodon.social avatar

Once upon a time, I used to take an active part in the Pull Request Challenge (and later in the Pull Request Club). When addresssing Perl::Critic violations in my assignment for the month, one violation which tended to crop up often was stringy eval. Generally, this is something to be avoided. But how? In the post below I discuss recommended best practices and some other options.

https://peateasea.de/avoiding-stringy-eval-in-perl/

ferki,
@ferki@fosstodon.org avatar

@peateasea Thanks for publishing and sharing!

If one would like to use a core module instead of try_load_class() from Class::Load, they might be interested in can_load() from Module::Load::Conditional:

https://metacpan.org/pod/Module::Load::Conditional

Particulary in tests, one may also be interested in either of:

Hope these are useful additions for readers wishing to avoid stringy evals! Happy hacking :)

peateasea,
@peateasea@mastodon.social avatar

@ferki Oh! I wasn't aware of those options. Many thanks for sharing that info!

peateasea,
@peateasea@mastodon.social avatar

@ferki just so you know: I've updated my post to include the info you mention. Thanks again for the heads up!

ferki,
@ferki@fosstodon.org avatar

@peateasea oh, thank you for including it in your post! :blobcataww:

I'm glad you found it so useful!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • kavyap
  • DreamBathrooms
  • modclub
  • tacticalgear
  • GTA5RPClips
  • magazineikmin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • rosin
  • slotface
  • everett
  • mdbf
  • cubers
  • JUstTest
  • ngwrru68w68
  • normalnudes
  • cisconetworking
  • Durango
  • khanakhh
  • Leos
  • ethstaker
  • tester
  • anitta
  • osvaldo12
  • megavids
  • provamag3
  • lostlight
  • All magazines