Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^6: The future of Perl?

by morgon (Priest)
on Dec 14, 2014 at 18:44 UTC ( [id://1110325]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package FixedSizeQueue;
    use Moose;
    ...
     push @{$this->items}, $item;
     shift @{$this->items} if scalar @{$this->items} > $this->max_size;
    }
    
  2. or download this
    my $q = FixedSizeQueue->new(max_size => 3);
    $q->push(3);
    ...
    $q->push(7);
    $q->push(9);
    print Dumper($q);
    
  3. or download this
    sub BUILDARGS {
      my($this, $max_size)=@_;
    
      return { max_size => $max_size };
    }
    
  4. or download this
    my $q = FixedSizeQueue->new(3);
    $q->push(3);
    ...
    $q->push(7);
    $q->push(9);
    print Dumper($q);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1110325]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found