i think you are right about the state of the shell. typically the ‘do shell script’ calls ‘sh’, while on the termnal you use ‘bash’. it’s probably some path you have that the ‘do shell script’ does not.
try this, at the terminal type:
and then run this:
set myPath to (do shell script "/bin/echo $PATH")
display dialog myPath
and see how they are different. you may have to specifically set a path in your perl script. i’ll look into that.
obviously i’m not a perl expert, nor do i play one on TV. however, after checking this article it seems that your LWP/UserAgent.pm is not installed in perl’s default path. for some reason you must have that path in your user account. i don’t quite understand how all of this works, but you should be able to get the perl path that AppleScript is calling like this:
set myPerl to (do shell script "/usr/bin/perl -le 'print for @INC'")
display dialog myPerl
it seems to me that if you moved LWP/UserAgent.pm into one of those paths, you should be ok. you could also try to add the LWP/UserAgent.pm’s current path to perl, but you’d probably need to go to a perl messageboard to find that kind of info.
Bareword found where operator expected at -e line 1, near “/Library/Perl”
(Missing operator before Perl?)
Bareword found where operator expected at -e line 1, near “1.pl”
(Missing operator before pl?)
syntax error at -e line 1, near “/Library/Perl”
Execution of -e aborted due to compilation errors
that indicates a problem with the perl file. without seeing and testing it, i would not be able to diagnose. hopefully someone else may have a bit more perl knowledge, but i’m really out of my depth here.