[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldsync-hackers] Problems with Palm::Datebook



Also, when using THIS code from Rich Bowen on the list
I get these errors (And yes, I get the same error if I
use the same code with modified paths on linux).  Can
anyone -please- help me get either of these working? 
I've read through the docs repeatedly and I'm not sure
why neither piece of code is working for me.

Thanks,
shawn looker

###  CODE ####
C:\Documents and
Settings\Administrator\Desktop\PERLST~1>perl
testentry.pl
Can't locate object method "PackAppInfoBlock" via
package "Palm::PDB" at C:/Perl
/site/lib/Palm/PDB.pm line 973, <DATA> line 19.


#!/usr/bin/perl
use Palm::Datebook;

my $pdb = new Palm::PDB;

$pdb->Load("$ENV{HOME}/.palm/backup/DatebookDB.pdb");
my $datebook;

foreach my $event ( @{$pdb->{records}} )     {
     $datebook->{ $event->{description} } = $event;
}

while (<DATA>)
{
	my ($day, $month, $year, $desc, $note) = split /~/,
$_;
     chomp($note);

     next if ( defined ( $datebook->{$desc} ) 
              && ( $datebook->{$desc}->{day} == $day )
              && ( $datebook->{$desc}->{month} ==
$month ) );
          
     my $record = $pdb->append_Record;
	$record->{"day"} = $day;
	$record->{"month"} = $month;
	$record->{"year"} = $year;
	$record->{"start_hour"} = 255;
	$record->{"start_minute"} = 255;
	$record->{"end_hour"} = 255;
	$record->{"end_minute"} = 255;
	$record->{"description"} = $desc;
	$record->{"note"} = "$note";
	$record->{"attributes"}{"dirty"} = 1;
	$record->{"category"} = 0;
     $record->{'repeat'} = { 'frequency' => 1, 
                            'type' => 5,
                            'unknown' => 0 };
     $record->{'alarm'} = {};                         
    

}

$pdb->Write("/tmp/DatebookDB.pdb");

__DATA__
31~1~2001~Nauru Independence Day~
1~2~2001~Robinson Crusoe Day~USA
2~2~2001~Candlemas~Sweden, Switzerland and
Liechtenstein
2~2~2001~Groundhog Day~USA, Canada, and Switzerland
3~2~2001~Heroes' Day~Mozambique
10~2~2001~Feast of St Paul's Shipwreck~Malta
11~11~2001~Armed Forces Day~Liberia
11~2~2001~Empire Day~Japan
11~2~2001~Mothers' Day~Norway
11~2~2001~Thomas Edison's Birthday~
14~2~2001~St. Valentine's Day~
15~2~2001~National Flag of Canada Day~Canada
15~2~2001~Rose Monday~Bolivia
15~2~2001~Spanish-Americal War Memorial
Day~Massachusetts, USA
15~2~2001~Susan B. Anthony Day~Florida, USA
16~2~2001~Gion Matsuri~Japan
16~2~2001~Lithuania Independence Day~1918
17~2~2001~National Public Science Day~USA
18~2~2001~Gambia Independence Day~






--- "Shawn L." <hyloth@yahoo.com> wrote:
> I get this when I dump the PDB before writing it:
> 
> C:\Documents and
> Settings\Administrator\Desktop\PERLST~1>perl test.pl
> 
> > log
> $VAR1 = bless( {
>                  'ctime' => 1066309114,
>                  'appinfo' => {
>                                 'lastUniqueID' =>
> 15,
>                                 'categories' => [
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => 'Unfiled',
>                                                    
> 'id' => 0
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 1
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 2
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 3
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 4
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 5
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 6
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 7
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 8
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 9
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 10
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 11
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 12
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 13
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 14
>                                                   },
>                                                   {
>                                                    
> 'renamed' => 0,
>                                                    
> 'name' => undef,
>                                                    
> 'id' => 15
>                                                   }
>                                                 ]
>                               },
>                  'creator' => '    ',
>                  'records' => [
>                                 {
>                                   'month' => '11',
>                                   'end_minute' =>
> 255,
>                                   'day' => '25',
>                                   'start_hour' =>
> 255,
>                                   'alarm' => {},
>                                   'id' => 0,
>                                   'category' => 0,
>                                   'start_minute' =>
> 255,
>                                   'description' =>
> 'Richmond C/A',
>                                   'attributes' => {
>                                                    
> 'Dirty' => 1,
>                                                    
> 'dirty' => 1
>                                                   },
>                                   'end_hour' => 255,
>                                   'note' => '<p>At
> Beth\'s house</p>',
>                                   'year' => '03'
>                                 },
>                                 {
>                                   'month' => '8',
>                                   'end_minute' =>
> 255,
>                                   'day' => '23',
>                                   'start_hour' =>
> 255,
>                                   'alarm' => {},
>                                   'id' => 0,
>                                   'category' => 0,
>                                   'start_minute' =>
> 255,
>                                   'description' =>
> 'Hampton Sabbat',
>                                   'attributes' => {
>                                                    
> 'Dirty' => 1,
>                                                    
> 'dirty' => 1
>                                                   },
>                                   'end_hour' => 255,
>                                   'note' => '<p>Game
> at Beth\'s house</p>',
>                                   'year' => '03'
>                                 },
>                                 {
>                                   'month' => '9',
>                                   'end_minute' =>
> 255,
>                                   'day' => '7',
>                                   'start_hour' =>
> 255,
>                                   'alarm' => {},
>                                   'id' => 0,
>                                   'category' => 0,
>                                   'start_minute' =>
> 255,
>                                   'description' =>
> 'Hampton C/A',
>                                   'attributes' => {
>                                                    
> 'Dirty' => 1,
>                                                    
> 'dirty' => 1
>                                                   },
>                                   'end_hour' => 255,
>                                   'note' => '<p>Game
> at beth\'s place.</p>',
>                                   'year' => '03'
>                                 }
>                               ],
>                  'mtime' => 1066309114,
>                  'version' => 0,
>                  'name' => '',
>                  'modnum' => 0,
>                  '2NULs' => '  ',
>                  'baktime' => '-2082844800',
>                  'type' => '    ',
>                  'uniqueIDseed' => 0,
>                  'attributes' => {}
>                }, 'Palm::StdAppInfo' );
> 
> --- "David A. Desrosiers" <hacker@gnu-designs.com>
> wrote:
> > 
> > > Any help would be greatly appreciated.
> > 
> > 	And what happens when you dump the data with
> > ::Dumper?
> > 
> > 
> > d.
> > 
> > This message was sent through the coldsync-hackers
> > mailing list.  To remove
> > yourself from this mailing list, send a message to
> > majordomo@thedotin.net
> > with the words "unsubscribe coldsync-hackers" in
> the
> > message body.  For more
> > information on Coldsync, send mail to
> coldsync-hackers-owner@thedotin.net.
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> This message was sent through the coldsync-hackers
> mailing list.  To remove
> yourself from this mailing list, send a message to
> majordomo@thedotin.net
> with the words "unsubscribe coldsync-hackers" in the
> message body.  For more
> information on Coldsync, send mail to
coldsync-hackers-owner@thedotin.net.


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.