Palm-Progect

 view release on metacpan or  search on metacpan

lib/Palm/Progect.pm  view on Meta::CPAN

            if ($i < @records) {
                for (my $j = $i + 1; $j < @records; $j++) {

                    my $other_record = $records[$j];

                    last if $other_record->level < $rec->level;

                    if ($other_record->level == $rec->level) {
                        $rec->has_next(1);
                        last;
                    }
                }
            }
            # Same thing, working backwards
            for (my $j = $i - 1; $j > 0; $j--) {

                my $other_record = $records[$j];

                last if $other_record->level < $rec->level;

                if ($other_record->level == $rec->level) {
                    $rec->has_prev(1);
                    last;
                }
            }
        }
    }

    $self->records(@records);
}

=back

=begin internal_use_only

=head2 Utility Subroutines



=over 4

=item _db_name_from_filename

This is a subroutine, not a method.  Call it like:

    my $db_name = _db_name_from_filename($filename);

Given a filename, try to come up with a sensible name for the progect
database.  Remove the extension, the C<lbPG> prefix (if any), etc.

=back

=end internal_use_only

=cut

sub _db_name_from_filename {
    my $filename = shift;
    $filename =~ tr{\\}{/};
    $filename =~ tr{:}{/};
    $filename = (split m{/}, $filename)[-1];
    $filename =~ s/^lbPG-//;
    $filename =~ s/\..*?$//;
    return $filename;
}

1;

__END__

=head1 BUGS and CAVEATS

=head2 Categories

Palm::Progect reads and writes categories properly from and to Progect C<PDB>
files.  As of version 0.25, Progect itself can read these categories properly.

Versions of Progect earlier than 0.25 may have problems reading
the categories as saved by Palm::Progect.

This is due to the fact that Palm::Progect does not write the preferences
block correctly.

As a result, when you load into an older version of Progect a database
that you created with Palm::Progect, You will get a warning that "Your
preferences have been deleted".

Progect will then reset the category list.

However, all of the records will still keep their references to the deleted
categories.

So, if you select "Edit Categories..." and recreate the categories
B<in the exact same order> as they were before, the records will
magically return to their proper categories.

Again, these steps are only required when you are using a version of
Progect that is older than version 0.25.

=head2 Preferences

Preferences are not handled properly yet.  They cannot be imported or
exported, and they are not read from the Progect database file.

Additionally, in Progect version 0.23 and earlier, when you load a
database created by Palm::Progect into Progect, you will get a warning
that "Your preferences have been deleted".  The preferences for the
database will be reset to sensible defaults.

In Progect version 0.25, you will not get this warning.

=head2 Two-digit Dates

Using a two digit date format will fail for dates before 1950
or after 2049 :).

=head1 AUTHOR

Michael Graham E<lt>mag-perl@occamstoothbrush.comE<gt>

Copyright (C) 2002-2005 Michael Graham.  All rights reserved.



( run in 0.819 second using v1.01-cache-2.11-cpan-71847e10f99 )