Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Data Structure needed for Event Queue

by jarich (Curate)
on May 28, 2002 at 05:10 UTC ( #169706=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub qpush
    {
         my ($self, $time, $eventref) = @_;
         push @{$self}, {time=>$time, event=>$eventref};
    }
    
  2. or download this
    sub qpop
    {
    ...
         my $ref = pop @{$self};
         return $ref->{event};
    }
    
  3. or download this
       # to call it:
    $queue->qinsert($time, $eventref);
    ...
                    }
            }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2022-05-21 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?