1

I am trying to run a Perl script directly from GitHub. This thread seems to address my issue (indeed, it helped me run dofiles in Stata directly from GitHub). However, when I type the following in a command prompt:

"perl https://rawgit.com/EconJoe/medline2014-xmlparsers/master/desc2014_meshtreenumbers.pl"

I get The following error message: "Can't open perl script "https://rawgit.com/EconJoe/medline2014-xmlparsers/master/desc2014_meshtreenumbers.pl": Invalid argument"

Thanks for any help.

3
  • perl doesn't know how to execute remote scripts like that. You'll have to fetch the file to the local system, then run it. Commented Sep 29, 2016 at 14:17
  • This is an extremely dangerous practice. The perl could contain qx{ rm -rf / }; and any number of exploits, self-installation of malware, etc, perhaps strongly obfuscated or buried a few thousand lines into an otherwise normal looking script or just through an accident, hacked account, or a test that wasn't intended to be used. Commented Sep 29, 2016 at 17:30
  • Thanks for the replies. Ashley--does this hold true if I am only using code in my own repositories? If so, is it any different from manually downloading and running code from GitHub? Commented Sep 30, 2016 at 18:44

1 Answer 1

6

perl can't fetch a script from a URL. You have to do that separately.

curl -L https://rawgit.com/EconJoe/medline2014-xmlparsers/master/desc2014_meshtreenumbers.pl | perl
Sign up to request clarification or add additional context in comments.

1 Comment

cpanm also uses this in its documentation to show how to install it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.