RosettaCodeData/Task/Queue-Definition/Perl/queue-definition-1.pl
2023-07-01 13:44:08 -04:00

4 lines
203 B
Perl

use Carp;
sub my push :prototype(\@@) {my($list,@things)=@_; push @$list, @things}
sub maypop :prototype(\@) {my($list)=@_; @$list or croak "Empty"; shift @$list }
sub empty :prototype(@) {not @_}