I use it as a subroutine and call if from the main script as shown here:
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
use CGI qw(:standard);
...
# validate login and get account information
...
$mailto="...@...com";
&sendnotification;
...
exit;
sub sendnotification{...
Cannot send mail from perl any longer after recent system upgrades on chopin
Error message: sendmail: sendmail cannot be called directly from a shell with the current user id
Example script:
open (MAIL, "| /usr/sbin/sendmail -t");
print MAIL "To: $mailto\n";
print MAIL "From...
Cannot send mail from perl any longer after recent system upgrades on chopin
Error message: sendmail: sendmail cannot be called directly from a shell with the current user id
Example script:
open (MAIL, "| /usr/sbin/sendmail -t");
print MAIL "To: $mailto\n";
print MAIL "From...
This is the whole thing, wrapped in a sub. - you are right $_[0] is the url you are attempting to get.
## Usage: $html=&getpage("http://yourwebsite.com/cgi-bin/page.cgi");
sub getpage {
use LWP::Simple qw($ua get);
my $ua = new LWP::UserAgent;
my $request = $_[0]...
Has anyone gotten a useragent request to work? My code shown below allows me to make a web request and puts the response in a variable. It works elsewhere, but when I attempt to use it here it never completes the get($request)
use LWP::Simple qw($ua get);
my $ua = new LWP::UserAgent...