[26675] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8782 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 20 21:05:18 2005

Date: Tue, 20 Dec 2005 18:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 20 Dec 2005     Volume: 10 Number: 8782

Today's topics:
        line-oriented debugger <Patrick_member@newsguy.com>
        line-oriented debugger <Patrick_member@newsguy.com>
    Re: Picking Up Perl <matthew.garrish@sympatico.ca>
    Re: Picking Up Perl <sisyphus1@nomail.afraid.org>
        Recursively Parsing through multipart messages use Mail <admin@ycdemocrats.org>
    Re: split by word using | as delimiter <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 20 Dec 2005 15:04:44 -0800
From: Patrick Flaherty <Patrick_member@newsguy.com>
Subject: line-oriented debugger
Message-Id: <doa2mc0dsf@drn.newsguy.com>

Hi,

The 'original' debugger.  I've looked all over the place and haven't yet been
able to answer this question.

I've liked to be able to issue two commands at once (well one-after-the-other
from a single cmd line).  As in DB<3> below:

  DB<2> b 101
  DB<3> c ; p $i

  Is this possible?

  (I supposed people are going to tell me - use a newer IDE/debugger).

  I actually like the old cmd-line debugger.

  pat



------------------------------

Date: 20 Dec 2005 15:28:55 -0800
From: Patrick Flaherty <Patrick_member@newsguy.com>
Subject: line-oriented debugger
Message-Id: <doa43n0i67@drn.newsguy.com>

Hi,

The 'original' debugger.  I've looked all over the place and haven't yet been
able to answer this question.

I've liked to be able to issue two commands at once (well one-after-the-other
from a single cmd line).  As in DB<3> below:

  DB<2> b 101
  DB<3> c ; p $i

  Is this possible?

  (I supposed people are going to tell me - use a newer IDE/debugger).

  I actually like the old cmd-line debugger.

  pat



------------------------------

Date: Tue, 20 Dec 2005 17:53:31 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Picking Up Perl
Message-Id: <GX%pf.1626$1Y4.151250@news20.bellglobal.com>


"rbt" <rbt@athop1.ath.vt.edu> wrote in message 
news:do9odi$5pg$1@solaris.cc.vt.edu...
>
> What books (if any) target Perl on Windows? I need info on accessing the 
> Windows API, creating services, managing processes, etc and I prefer 
> proper books over online only material.

Learning Perl on Win32
Win32 Perl Scripting: The Administrator's Handbook
Win32 Perl Programming: The Standard Extensions
Programming Perl in the .Net Environment

The only one I've looked at (i.e., can give an opinion on) is Win32 Perl 
Scripting, which gave me some ideas but is hardly a beginner's book.

> Also, what impact will Perl 6 have on the things I learn in Perl 5?

Don't waste your time worrying about Perl6. Perl 5 is going to be the 
standard for a long time to come and Perl 6 will be able to run Perl 5 code.

Matt 




------------------------------

Date: Wed, 21 Dec 2005 10:14:16 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Picking Up Perl
Message-Id: <43a890b2$0$21121$afc38c87@news.optusnet.com.au>


"rbt" <rbt@athop1.ath.vt.edu> wrote in message
 .
 .
>
> What books (if any) target Perl on Windows? I need info on accessing the
> Windows API, creating services, managing processes, etc and I prefer
> proper books over online only material.

I have Dave Roth's 'Win32 Perl Programming: The Standard Extensions'. From
your description, I think you would find it useful. He has also written a
subsequent book on Win32 perl programming. See http://www.roth.net/perl/ .
O'Reilly might also publish a Win32-specific (perl) book or 2 .... not sure.
 .
 .
>
> Also, what impact will Perl 6 have on the things I learn in Perl 5? Will
> knowledge gained in 5 carry over to 6 or will I have to re-learn things
> that have been implemented differently?
>

A bit of both, I believe. Much is the same, but some things will be
different.

Cheers,
Rob




------------------------------

Date: Wed, 21 Dec 2005 01:06:35 GMT
From: Bloch <admin@ycdemocrats.org>
Subject: Recursively Parsing through multipart messages use Mail::Box::Manager;
Message-Id: <vU1qf.5533$vJ4.153@trnddc07>

I've written a little script that uses mailbox manager to parse an mbox
file, strip off most of the headers, decode the body, and eventually print
the data that is encoded as text/plain.  It works fine for messages that
are flat (i.e., multipart/alternative on the top level) and it can just
grab the plaintext attachments from 1 level down.

I run into problems when I hit multipart/mixed messages  and I have to
descend down a level.  I've been reading through the groups.google.com
archives and and the man pages of these modules and see that applying
these items recursively is tricky for inexperienced programmers -- which
I claim to be. Can someone recommend a better way of getting to my desired
endpoint, or help me sort out how to get there using my existing approach?  

I've attached the relevent portion of my code and the output of
printStructure to give a better idea of the problem domain.

#!/usr/local/bin/perl
                                                                                
use Mail::Box::Manager;
use Date::Parse;
use warnings;
use strict;
my $mgr = Mail::Box::Manager->new;
#my $folder_file = "/home/salvador/mail/releases"; my $folder_file =
"/home/salvador/mail/releases.old"; my $folder = $mgr->open(folder =>
$folder_file) or die "Could not open folder $!n";
my(@subject,@sender,@body,@time);
my $x = 0;
for ($folder->messages) {
   $subject[$x] = $_->subject;
   $sender[$x] =  $_->sender->address;
   $time[$x] = $_->get('Date');
   #body[$x] = $decode = $_->decoded;
  #$_->printStructure;
                                                                                
  if($_->isMultipart) {
   foreach my $part($_->body->parts) {
    my $attached_head = $part->head;
    my $attached_body = $part->decoded;
    if($attached_head =~ /text\/plain/) {
     # print "$attached_head\n";
     #  print "OK\n";
     }elsif($attached_head =~ /multipart\/alternative/i) {
        print "$attached_head\n";
        print "Crap\! How do I parse the next batch of headers?\n"; print
        "$attached_body";
     }
    }
    }
   $x++;
}

PARTIAL OUTPUT OF MESSAGE STRUCTURES:

OK:
multipart/alternative: KENNEDY:  AMERICANS DESERVE BETTER THAN A
REPUBLICAN BUDGET THAT LEAVES THEM BEHIND (111850 bytes)
   text/plain (47689 bytes)
   text/html (62436 bytes)

OK:
multipart/alternative: Boxer Asks Legal Scholars on Dean's 'Impeachable
Offense' Comment (10116 bytes)
   text/plain (2647 bytes)
   text/html (5495 bytes)

OK:
multipart/alternative: Sen. Jeffords' Statement on ANWR/Defense Spending
Bill  (8876 bytes)
   text/plain (1030 bytes)
   text/html (5864 bytes)

FAILS TO PARSE PROPERLY:
multipart/mixed: KENNEDY: REPUBLICANS BLOCK INTELLIGENCE BILL TO AVOID THE
TRUTH OF THE WAR (202224 bytes)
   multipart/alternative (146945 bytes)
      text/plain (54877 bytes)
      text/html (91778 bytes)
   application/msexcel (53598 bytes)

 ...


------------------------------

Date: Tue, 20 Dec 2005 18:01:01 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: split by word using | as delimiter
Message-Id: <slrndqh6pt.9os.tadmc@magna.augustmail.com>

William <wh2leung@student.cs.uwaterloo.ca> wrote:

>     my @instrumentEntries = ( split(/|/, $currentLine) );


The vertical bar is "meta" in regular expressions, it
allows alternations (or).


> what is the correct way to split $currentLine of the input file?


Backslash metacharacters to match a literal character:

   my @instrumentEntries = ( split(/|/, $currentLine) );


> P.S. i already checked perldoc -f split and perldoc -q split.


Thanks for doing that.

The reason you didn't find the answer there is because you
had a problem with your regex rather than with split().


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8782
***************************************


home help back first fref pref prev next nref lref last post