RosettaCodeData/Task/Priority-queue/Perl/priority-queue-1.pl

15 lines
313 B
Perl
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
use 5.10.0;
use strict;
use Heap::Priority;
my $h = new Heap::Priority;
$h->highest_first(); # higher or lower number is more important
$h->add(@$_) for ["Clear drains", 3],
2014-01-17 05:32:22 +00:00
["Feed cat", 4],
["Make tea", 5],
["Solve RC tasks", 1],
["Tax return", 2];
2013-04-10 23:57:08 -07:00
say while ($_ = $h->pop);