> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/perl6-rosettacode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/q/queue/usage.md).

# Usage

Raku maintains the same list operators of Perl 5, for this task, the operations are:

```
push (aka enqueue) -- @list.push
pop (aka dequeue)  -- @list.shift
empty              -- !@list.elems
```

but there's also @list.pop which removes a item from the end, and @list.unshift which add a item on the start of the list.

Example:

```perl
my @queue = < a >;

@queue.push('b', 'c'); # [ a, b, c ]

say @queue.shift; # a
say @queue.pop; # c

say @queue; # [ b ]
say @queue.elems; # 1

@queue.unshift('A'); # [ A, b ]
@queue.push('C'); # [ A, b, C ]
```
