Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Queue-Usage/Perl/queue-usage-1.pl
Normal file
11
Task/Queue-Usage/Perl/queue-usage-1.pl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
@queue = (); # we will simulate a queue in a array
|
||||
|
||||
push @queue, (1..5); # enqueue numbers from 1 to 5
|
||||
|
||||
print shift @queue,"\n"; # dequeue
|
||||
|
||||
print "array is empty\n" unless @queue; # is empty ?
|
||||
|
||||
print $n while($n = shift @queue); # dequeue all
|
||||
print "\n";
|
||||
print "array is empty\n" unless @queue; # is empty ?
|
||||
3
Task/Queue-Usage/Perl/queue-usage-2.pl
Normal file
3
Task/Queue-Usage/Perl/queue-usage-2.pl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
1
|
||||
2345
|
||||
array is empty
|
||||
Loading…
Add table
Add a link
Reference in a new issue