X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=Equinox-Migration%2Flib%2FEquinox%2FMigration%2FSimpleTagList.pm;h=c596d06f4ca7d7e9274d8eef941da749bab73f36;hp=25ef631a07302f61f13300be3b4bc85030bbd196;hb=f3f1703187556e900e3b1b5e0f00ef8cce14da52;hpb=0a1fe57919524c3f47b28ccbac50fad8ac9cd8df diff --git a/Equinox-Migration/lib/Equinox/Migration/SimpleTagList.pm b/Equinox-Migration/lib/Equinox/Migration/SimpleTagList.pm index 25ef631..c596d06 100644 --- a/Equinox-Migration/lib/Equinox/Migration/SimpleTagList.pm +++ b/Equinox-Migration/lib/Equinox/Migration/SimpleTagList.pm @@ -40,8 +40,8 @@ or =head2 new -Takes one argument, optional argument, C. If this is speficied, -the tag list will be populated as per that file on instantiation. +Takes one optional argument, C. If this is speficied, the tag +list will be populated as per that file on instantiation. Returns a E::M::STL object. @@ -109,12 +109,16 @@ sub generate { open TAGFILE, '<', $self->{conf}{file}; while () { + next if m/^#/; + next if m/^\s*\n$/; + $self->{conf}{lastwasrange} = 0; $self->{conf}{range}{high} = 0; $self->{conf}{range}{low} = 0; my @chunks = split /\s+/; while (my $chunk = shift @chunks) { + last if ($chunk =~ /^#/); # single values if ($chunk =~ /^\d{1,3}$/) { @@ -178,6 +182,8 @@ sub add_tag { my ($self, $tag) = @_; $tag =~ s/^0+//; + die "Values must be numeric\n" if ($tag =~ /[^\d\-]/); + die "Values must be valid tags (0-999)\n" unless ($tag >= 0 and $tag <= 999); @@ -216,7 +222,7 @@ Please report any bugs or feature requests to the above email address. You can find documentation for this module with the perldoc command. - perldoc Equinox::Migration::TrashTags + perldoc Equinox::Migration::SimpleTagList =head1 COPYRIGHT & LICENSE