This little thingy extracts of a Palm Addressbook DB
#!/usr/bin/perl -w use strict; use Palm::Address; my $debug=0; my $maxcount=0; ########### main ######### my $pdb = new Palm::Address; $pdb->Load("AddressDB.pdb"); my $count=0; foreach my $record (@{$pdb->{records}}) { # only select natural persons sporting stuff in custom4 next unless( defined $record->{fields}{name} and $record->{fields}{name} and defined $record->{fields}{custom4} and $record->{fields}{custom4} ); my $sn=$record->{fields}{name}; my $dates=$record->{fields}{custom4}; my $extras=(defined $record->{fields}{custom1})?'('.$record->{field +s}{custom1}.')':''; my $gn=(defined $record->{fields}{firstName})?$record->{fields}{fir +stName}:''; $debug and print "surname: $sn\n","givenname: $gn\n","extras: $extr +as\n","dates: $dates\n\n"; my @dates=split(/\n/,$dates); # one entry per line in custom4 foreach my $date (@dates){ my $event=''; my $name=''; if($date=~/^(\S+)\s+(.*)/){ # more than just a birthday? $event=$1; $date=$2; if($date=~/^(\S+)\s+(\S+)/){$date=$2;$name=$1}; # supercede g +ivenname if given here :-) }else{ $event='*'; # just a birthday } print "$date\t$event\t",($name?$name:$gn)," $sn\t$extras\n"; } last if($maxcount and ++$count>$maxcount); }

In reply to Palm::Address Birthday-/Anniversary-Extractor by mhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.