RosettaCodeData/Task/Queue-Definition/Perl/queue-definition-1.pl

5 lines
203 B
Perl
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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 @_}