Click here to get back home

Print Subject without characters Just Numbers using POP3Client. Please Help

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Print Subject without characters Just Numbers using POP3Client. Please Help eng.john84 04-10-2007
Posted by eng.john84 on April 10, 2007, 11:27 pm
Please log in for more thread options


I`m using POP3Client,
I don`t need to print all subject i need to print just number.
i.e --> if Subject: John 1234567890, Then i need to print 1234567890


use Mail::POP3Client;


$pop = new Mail::POP3Client( USER => "xxxxxxxxxxxxxxxxx",
PASSWORD => "xxxxxxxxxx",
HOST => "xxxxxxxxxx" );

for ($i = 1; $i <= $pop->Count(); $i++) {
foreach ( $pop->Head( $i ) ) {
/^(From|Subject):\s+/i and print $_, "\n";
}
print "\n";
sleep 5;
}


Posted by Sisyphus on April 10, 2007, 11:48 pm
Please log in for more thread options



> I`m using POP3Client,
> I don`t need to print all subject i need to print just number.
> i.e --> if Subject: John 1234567890, Then i need to print 1234567890
>

I don't understand - there is usually *no* number associated with the
Subject. At least that's the way it is for me when I run the script you
provided. Typical output is:

----------
Subject: Decimal arithmetic
----------

The only time I see numbers is when the person writing the email has
included numeric character(s) in the subject. eg:

----------
Subject: [Mingw-users] mingw with g++ 4.x
----------

Cheers,
Rob


Posted by Sisyphus on April 10, 2007, 11:51 pm
Please log in for more thread options



> I`m using POP3Client,
> I don`t need to print all subject i need to print just number.
> i.e --> if Subject: John 1234567890, Then i need to print 1234567890
>

I don't understand - there is usually *no* number associated with the
Subject. At least that's the way it is for me when I run the script you
provided. Typical output is:

----------
Subject: Decimal arithmetic
----------

The only time I see numbers is when the person writing the email has
included numeric character(s) in the subject. eg:

----------
Subject: [Mingw-users] mingw with g++ 4.x
----------

Cheers,
Rob


Posted by odhiseo on April 12, 2007, 9:47 pm
Please log in for more thread options


>
>
> > I`m using POP3Client,
> > I don`t need to print all subject i need to print just number.
> > i.e --> if Subject: John 1234567890, Then i need to print 1234567890
>
> I don't understand - there is usually *no* number associated with the
> Subject. At least that's the way it is for me when I run the script you
> provided. Typical output is:
>
> ----------
> Subject: Decimal arithmetic
> ----------
>
> The only time I see numbers is when the person writing the email has
> included numeric character(s) in the subject. eg:
>
> ----------
> Subject: [Mingw-users] mingw with g++ 4.x
> ----------
>
> Cheers,
> Rob


Maybe you want the Message-ID:

use Mail::POP3Client;

$pop = new Mail::POP3Client( USER => "xxxxxxxxxxxxxxxxx",
PASSWORD => "xxxxxxxxxx",
HOST => "xxxxxxxxxx" );

for ($i = 1; $i <= $pop->Count(); $i++) {
foreach ( $pop->Head( $i ) ) {
/^(Message-ID):\s+/i && print $_, "\n";
}
print "\n";
sleep 5;
}


Posted by odhiseo on April 12, 2007, 9:55 pm
Please log in for more thread options


>
>
>
>
>
> > > I`m using POP3Client,
> > > I don`t need to print all subject i need to print just number.
> > > i.e --> if Subject: John 1234567890, Then i need to print 1234567890
>
> > I don't understand - there is usually *no* number associated with the
> > Subject. At least that's the way it is for me when I run the script you
> > provided. Typical output is:
>
> > ----------
> > Subject: Decimal arithmetic
> > ----------
>
> > The only time I see numbers is when the person writing the email has
> > included numeric character(s) in the subject. eg:
>
> > ----------
> > Subject: [Mingw-users] mingw with g++ 4.x
> > ----------
>
> > Cheers,
> > Rob
>
> Maybe you want the Message-ID:
>
> use Mail::POP3Client;
>
> $pop = new Mail::POP3Client( USER => "xxxxxxxxxxxxxxxxx",
> PASSWORD => "xxxxxxxxxx",
> HOST => "xxxxxxxxxx" );
>
> for ($i = 1; $i <= $pop->Count(); $i++) {
> foreach ( $pop->Head( $i ) ) {
> /^(Message-ID):\s+/i && print $_, "\n";
> }
> print "\n";
> sleep 5;
> }

Sorry, now I understood your question

use Mail::POP3Client;

$pop = new Mail::POP3Client( USER => "xxxxxxxxxxxxxxxxx",
PASSWORD => "xxxxxxxxxx",
HOST => "xxxxxxxxxx" );

for ($i = 1; $i <= $pop->Count(); $i++) {
foreach ( $pop->Head( $i ) ) {
/^Subject:\.+\s(\d+)/i && print $1, "\n";
}
print "\n";
sleep 5;
}


Similar ThreadsPosted
How to print just numbers includes in Subject using POP3Client Module. April 9, 2007, 9:18 pm
Mail::Sender: Encoding of subject November 17, 2004, 12:56 am
CGI.PM and print table April 13, 2008, 1:18 pm
Net:Telnet problem with print October 20, 2005, 5:04 pm
Image::Magick scalar value to print use CGI April 13, 2006, 10:09 pm
POP3Client problem with SSL February 20, 2005, 4:42 pm
First line in body of Mail::POP3Client March 23, 2007, 9:43 am
I have problem with POP3Client&Sendmail Module, Please Help. April 20, 2007, 4:34 am
strings and numbers July 30, 2005, 2:28 am
strings and numbers July 30, 2005, 2:27 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap