Search code examples
perllwp

What arguments are missing from my Perl LWP command?


I'm trying to pull a photo from a webcam, and save it to a file. This is the command:

/usr/bin/perl -MLWP::Simple -e 'getstore "https://website.com/image”,”/home/images/image.jpg"'

When I run it, I get the following error:

Not enough arguments for LWP::Simple::getstore at -e line 1, at EOF

What arguments are missing from my LWP:Simple command? The manual for LWP does not explain much regarding the "-e" option.


Solution

  • The problem is you have some non-ASCII quotes in there. Specifically the 2nd and 3rd are U+0201D RIGHT DOUBLE QUOTATION MARK. Because of that, Perl is reading "https://website.com/image”,”/home/images/image.jpg" as a single string. So you've only passed one argument to getstore.

    The manual for LWP does not explain much regarding the "-e" option.

    -e is an option for perl itself, not LWP::Simple. For more on -e see perlrun.