My Perl scripts don't run anymore



Stupidly, I ran the script below (copied from the book 'Perl - I Didn't Know
You Could Do That...' by Martin C. Brown) without understanding what the
script was doing. Now, none of my Perl scipts run anymore - all that happens
is that the command prompt window is minimised and a Windows Wordpad window
containing my script, pops up. I'm running v5.8.6 on a W32 system. Can
anyone tell me what I've done and how I correct it? Instict tells me it
might have something to do with the use of the Getopt::Std module, but I
really don't know.

use Net::POP3;
use Net::SMTP;
use Getopt::Std;

getopts('q');

my ($host, $login, $password) = ('atuin', 'mcbmac', 'Tamsin');

my $server = Net::POP3->new($host, Debug => 99999);
warn "Couldn't connect to server $host" unless $server;
my $nomsgs = $server->login($login, $password);

die "Could not login" unless defined($nomsgs);

my $msglist = $server->list();
$nomsgs = keys %$msglist;

print "There are $nomsgs messages on $host\n";

foreach my $msg_id (keys %$msglist)
{
my $msgcontent = $server->get($msg_id);
forward($msgcontent, 'mc@xxxxxxxxxxx', 'mc@xxxxxxxxxxx');
}

$server->quit();

sub forward
{
my ($message, $from, $to) = @_;
$smtp = Net::SMTP->new('mail');
die "Couldn't open connection to server" unless $smtp;
$smtp->mail($from) or die "Bad 'from' address";
$smtp->to($to) or die "Bad 'to' address";
$smtp->data();
$smtp->datasend(join('',@$message));
die "Connection wouldn't accept data"
unless($smtp->dataend());
}


.



Relevant Pages

  • IIS web site debugging problems in ASP
    ... I have a web server running IIS 5.0 in Windows 2k. ... different web sites using the same set of ASP/SQL code. ... script debugging on the second site. ... script that popped up in the debug window is for an entirely different ...
    (microsoft.public.inetserver.iis)
  • Re: Closing and refreshing windows
    ... >From server side still you can use this client side script to do this work. ... "<script to referesh parent window ...
    (microsoft.public.dotnet.framework.aspnet)
  • window server 2003: Setup Required to Run Scripts Remotely
    ... I need help with setting up WSH5.6 on Window Server 2003. ... I failed to ran a remote script on window 2003 at the permission error. ...
    (microsoft.public.windows.server.scripting)
  • Re: Launch chm file on WS within HTML
    ... This causes a 'Page Cannot be Displayed' in a 'Cannot find server' window. ... I wish to launch an executable from a web page residing ... However, since the script seems to run, it ...
    (microsoft.public.scripting.wsh)
  • Re: retrieving usenet messages III
    ... clear that the script didn't attempt to authenticate. ... It would be best if you carefully parsed anything that the server sends ... #perl exe's opinion followed by source script ... $nntp->authinfoor die $!; ...
    (comp.lang.perl.misc)