I want to extract the subject from the e-mail but $1 is empty.... I don't know what i do wrong... Maybe Regexp or bad variable.#!/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 eq "undef"){ print "Couldn't connect $!\n"; exit; } else { print "On $time e-mail status inbox: $res post \n"; } print "Write id(number) email to read:\n"; chomp(my $msgnum = <STDIN>); my $msg = $pop->get($msgnum); if($msg =~ /Subject:(.*)From:/){ #I think that there is a error here print "Subject is $1"; } $pop->quit();
In reply to Problem with $1 by w3b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |