#!/usr/bin/perl
use strict;
use diagnostics;
use warnings;
use Carp 'verbose';
use PDA::Pilot; # part of pilot-link, not in CPAN
# it's the last value which makes the program fail;
# and it fails only for the value 11!
my @rec = (0,0,0,0,0,0,0,0,11);
my %info = ("type" =>"Data",
"creator" =>"XXXX",
"name" =>"test");
my $pdb = PDA::Pilot::File::create("test.pdb", \%info )
or die "something went wrong\n";
my $rec = join('', map(chr, @rec));
# It dies here, line 23
$pdb->addRecordRaw($rec,0,0,0);
####
Can't call method "Raw" without a package or object reference
####
int addRecordRaw(self, data, uid, attr, category)
PDA::Pilot::File *self
SV *data
unsigned long uid
int attr
int category
CODE:
{
STRLEN len;
int result;
void *buf;
PackRaw;
buf = SvPV(data, len);
RETVAL = pi_file_append_record(self->pf,
buf, len, attr, category, uid);
}
OUTPUT:
RETVAL
####
sub Raw {
# Just copy the "raw" item straight through
my($self) = @_;
return $self->{raw};
}