From 608727861d719340bebde060a59020f3e0467682 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 5 Feb 2006 17:47:36 +0200 Subject: [PATCH] Minor fix and comments in Locale::PO: The load_file function binds $/ and $_ dynamically. Added comments about the fields of Locale::PO objects. --- po/perl/Locale/PO.pm | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/po/perl/Locale/PO.pm b/po/perl/Locale/PO.pm index ee404da8..89e6dcc6 100644 --- a/po/perl/Locale/PO.pm +++ b/po/perl/Locale/PO.pm @@ -7,9 +7,25 @@ use warnings; package Locale::PO; use Carp; -use fields qw(msgid msgid_plural msgstr msgstr_n - comment automatic reference - fuzzy c_format php_format); + +# Internally, each Locale::PO object is a reference to a hash +# (or pseudo-hash, for Perl < 5.9) with the following keys. +# The format of the hash is subject to change; other modules +# should use the accessor methods instead. +use fields + # Multiline strings including quotes and newlines, but excluding + # the initial keywords and any "#~ " obsoletion marks. Can be + # either undef or "" if not present. These end with a newline + # if not empty. + qw(msgid msgid_plural msgstr), + # A reference to a hash where keys are numbers (as strings) + # and values are in the same format as $self->{msgstr}. + qw(msgstr_n), + # Multiline strings excluding the trailing newline and comment + # markers, or undef if there are no such lines. + qw(comment automatic reference), + # Flags; see the accessors with the same names. + qw(fuzzy c_format php_format); #use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); #use locale; @@ -256,6 +272,8 @@ sub load_file { my $po; my %buffer; my $last_buffer; + local $/ = "\n"; + local $_; open( IN, "<$file" ) or return undef; while () { @@ -608,6 +626,11 @@ POD changes: Greatly expanded the L section. Reformatted this list of changes. +=item Z<>2006-02-05 Kalle Olavi Niemitalo + +Added comments about the fields of Locale::PO objects. +The load_file function binds $/ and $_ dynamically. + =back =head1 COPYRIGHT AND LICENSE