Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check eval statements in DataCiteEvent.pm #62

Open
jesusbagpuss opened this issue Dec 4, 2024 · 0 comments
Open

Check eval statements in DataCiteEvent.pm #62

jesusbagpuss opened this issue Dec 4, 2024 · 0 comments

Comments

@jesusbagpuss
Copy link

This needs a sanity check - I may have confused myself!

I think these two lines are redundant, and have been superceeded by the lines below.

eval "use LWP; use HTTP::Headers::Util";
eval "use WWW::Curl::Easy";

These following two sets of evals appear to be incorrect, and will not print the error message if the module isn't available?

if ( eval "use WWW::Curl::Easy" ) { print STDERR "Unable to import WWW::Curl::Easy.\n"; }

if ( eval "use LWP" ) { print STDERR "Unable to import LWP.\n"; }
if ( eval "use HTTP::Headers::Util" ) { print STDERR "Unable to import HTTP::Headers::Util.\n"; }

If I replicate the above with a non-existent module:
perl -e 'if ( eval "use Wibble::Dodah" ) { print STDERR "Unable to import Wibble::Dodah.\n"; }'
it doesn't print the error message.

There may be some trickery going on here - but I think I would expect the eval return to be undef if the module isn't available..?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant