#! perl -slw use strict; use Data::Dumper; use Carp qw/clue/; use QuotePlus; $::debug = 0; my $quote = new QuotePlus ({ phrase=>"It's a good day to die!", author=>"Kahless", approved=>1, date=>"25530", }); printf "%8s said: '%s'; circa. %.f\n", $quote->author(), $quote->phrase(), $quote->date(); $quote->date() = 2500; $quote->author() = "Kahless is reputed to have"; printf "%8s said: '%s'; circa. %.f\n", $quote->author(), $quote->phrase(), $quote->date(); my @quotes; while () { chomp; my ($when, $who, $what) = split/\t/; clue "$when, $who, $what"; push @quotes, new QuotePlus ({ phrase=>$what, author=>$who, approved=>1, date=>$when, }); clue $quotes[-1]; } close DATA; my $i=0; for my $quote (@quotes) { clue $quote; next unless $quote->is_approved; printf "Quote %2d - %8s said: '%s'; circa. %.f\n", $i++, $quote->author(), $quote->phrase(), $quote->date(); } printf "%8s said: '%s'; circa. %.f\n", $quote->author(), $quote->phrase(), $quote->date(); __DATA__ 26584.2 Kahless It's a good day to die! 26593.7 Kahless May your blood scream. 26601.1 Kahless May your enemies run with fear. 26603.2 Kahless Celebrate!? Tomorrow we may die! 26611.4 Kahless May you die before you are captured. 26653.9 Kahless May you always find a Bloodworm in your glass. 26658.3 Kahless May your co-ordinants be free of Tribbles. 26671.2 Kahless May you die in battle. 26671.3 Kahless May you die well. 26777.7 Kahless May you endure the pain. 26821.2 Kahless Klingons forever! 26822.1 Kahless We are KLINGONS! 26888.2 Kahless Qapla`!