w3b has asked for the wisdom of the Perl Monks concerning the following question:
I am to newbie to unknot this problem... i think that's array ref. or somethink...:(#!/usr/bin/perl use warnings; use strict; use Net::POP3; my $time = scalar localtime; my $pop3 = "pop3.poczta.onet.pl"; my $login = "haptor\@op.pl"; my $pass = "***************"; my $pop = Net::POP3->new($pop3); my $res = $pop->login($login, $pass); if ($res){ print"On $time e-mail status inbox: $res post \n"; } else { print "Couldn't connect $!\n"; exit; } my $msg; my $msgnum; do{ print "Write id(number) email to read subject:\n"; chomp($msgnum = <STDIN>); } while($msgnum > $res); $msg = $pop->get($msgnum); for my $line ( @$msg ) { if( $line =~ /^Subject:(.*)/ ) { print "Subject is $1\n"; last } } print "Read e-mail? [y/n]\n"; chomp(my $ans = <STDIN>); if ($ans =~ /y/i){ print "Messsage is:\n @$msg \n"; #problem } elsif ($ans =~ /n/i){ exit; } else { print "Bad!"; exit; } $pop->quit();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Almost success
by BUU (Prior) on Dec 04, 2005 at 01:53 UTC | |
by w3b (Beadle) on Dec 04, 2005 at 07:17 UTC |