Store each lines from a response...

Store each lines from a response...

am 28.03.2007 03:59:34 von Geist

Hello,

I'm not sure if it's the right place but it has something to do with
www library and other net libraries.
Here is my code :

my $pop = Net::POP3->new($server, Timeout => 60);

if ($pop->login($login, $passwd) > 0) {
my $msgnums = $pop->list;
foreach my $msgnum (keys %$msgnums) {
my $msg = $pop->get($msgnum);
print "My mail -> @$msg\n";
}
}

I want to split each lines of my mail (stored into @$msg)
Well, $msg is the reference of the array storing the mail response, Am I right ?
So when i use @$msg i'm getting the value the array reference with
$msg ? Still right ?
So why when i'm trying to use 'split('\n',@$msg);' i got returned a
'weird' number ?

Re: Store each lines from a response...

am 28.03.2007 06:34:10 von mumia.w.18.spam+nospam

On 03/27/2007 08:59 PM, geist wrote:
> Hello,
>
> I'm not sure if it's the right place but it has something to do with
> www library and other net libraries.
> Here is my code :
>
> my $pop = Net::POP3->new($server, Timeout => 60);
>
> if ($pop->login($login, $passwd) > 0) {
> my $msgnums = $pop->list;
> foreach my $msgnum (keys %$msgnums) {
> my $msg = $pop->get($msgnum);
> print "My mail -> @$msg\n";
> }
> }
>
> I want to split each lines of my mail (stored into @$msg)
> Well, $msg is the reference of the array storing the mail response, Am I
> right ?
> So when i use @$msg i'm getting the value the array reference with
> $msg ? Still right ?
> So why when i'm trying to use 'split('\n',@$msg);' i got returned a
> 'weird' number ?
>

The documentation for Net::POP3 suggests that $msg already contains the
message data split into lines; $msg is a reference to an array
containing the required data (already split), so there is no need to split.

Re: Store each lines from a response...

am 28.03.2007 13:42:56 von devilishentity

On 3/28/07, Mumia W. wrote:
> The documentation for Net::POP3 suggests that $msg already contains the
> message data split into lines; $msg is a reference to an array
> containing the required data (already split), so there is no need to split.
>

Ok, but i don't use any loop to get my mail displayed completly, how
could i get each lines separatly ?

Re: Store each lines from a response...

am 28.03.2007 14:35:03 von mumia.w.18.spam+nospam

On 03/28/2007 06:42 AM, Devilish Entity wrote:
> On 3/28/07, Mumia W. wrote:
>> The documentation for Net::POP3 suggests that $msg already contains the
>> message data split into lines; $msg is a reference to an array
>> containing the required data (already split), so there is no need to
>> split.
>>
>
> Ok, but i don't use any loop to get my mail displayed completly, how
> could i get each lines separatly ?
>

So use a loop to process the lines in the array separately.

If you are using Windows, check these out:
Start->Run->"perldoc perlintro"
Start->Run->"perldoc perllol"
Start->Run->"perldoc perl"