use strict; use PDF::API2::Simple; my %data = (...); #my $pdf = PDF::API2::Simple->new( file => 'file.pdf' } foreach my $keys( sort { $data{$a} <=> $data{$b}} keys %data ){ print $data{$keys}{'Name'}, "\n"; } #### use strict; use PDF::API2::Simple; my @names = (Diana Bruce Clark); my $pdf = PDF::API2::Simple->new( file => 'file.pdf' } foreach my $name( @names ){ $pdf->text($name}); }