First line in body of Mail::POP3Client
am 23.03.2007 14:43:16 von eng.john84
How to write this code if ( FIRST LINE IN BODY TRUE FOR EXAMPLE
HELLO)
{
print $_, "\n"; } please help me to wrile this code
code:
#!/usr/local/bin/perl
use Mail::POP3Client;
$pop = new Mail::POP3Client( USER => "xxxxxxxxx",
PASSWORD => "xxxxxxx",
HOST => "xxxxx" );
{
foreach ( $pop->Body( 1 ) ) {
if ( FIRST LINE IN BODY TRUE FOR EXAMPLE HELLO)
{
print $_, "\n";
}}}
Re: First line in body of Mail::POP3Client
am 23.03.2007 16:27:58 von keith
On Mar 23, 8:43 am, eng.joh...@gmail.com wrote:
> How to write this code if ( FIRST LINE IN BODY TRUE FOR EXAMPLE
> HELLO)
> {
>
> print $_, "\n"; } please help me to wrile this code
>
> code:
>
> #!/usr/local/bin/perl
>
> use Mail::POP3Client;
>
> $pop = new Mail::POP3Client( USER => "xxxxxxxxx",
> PASSWORD => "xxxxxxx",
> HOST => "xxxxx" );
>
> {
> foreach ( $pop->Body( 1 ) ) {
>
> if ( FIRST LINE IN BODY TRUE FOR EXAMPLE HELLO)
> {
>
> print $_, "\n";
>
> }}}
Unless I have missed the question entirely, I usually do something
like:
foreach ( $pop->Body( 1 ) ) {
last if ($firstLine++);
print $_, "\n";
}
But then, why bother w/ the look at all?
Re: First line in body of Mail::POP3Client
am 23.03.2007 17:42:00 von eng.john84
On Mar 23, 5:27 pm, "Keith" wrote:
> On Mar 23, 8:43 am, eng.joh...@gmail.com wrote:
>
> > How to write this code if ( FIRST LINE IN BODY TRUE FOR EXAMPLE
> > HELLO)
> > {
>
> > print $_, "\n"; } please help me to wrile this code
>
> > code:
>
> > #!/usr/local/bin/perl
>
> > use Mail::POP3Client;
>
> > $pop = new Mail::POP3Client( USER => "xxxxxxxxx",
> > PASSWORD => "xxxxxxx",
> > HOST => "xxxxx" );
>
> > {
> > foreach ( $pop->Body( 1 ) ) {
>
> > if ( FIRST LINE IN BODY TRUE FOR EXAMPLE HELLO)
> > {
>
> > print $_, "\n";
>
> > }}}
>
> Unless I have missed the question entirely, I usually do something
> like:
>
> foreach ( $pop->Body( 1 ) ) {
>
> last if ($firstLine++);
> print $_, "\n";
>
> }
>
> But then, why bother w/ the look at all?
Actually i check first word or line because if the line true (message
i need) ther`s a sms will send to my mobile as a reply back because
i`m not at home so, i need to check just first line (the above code
not works to me ) i hope to help me about this code THANKS