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

RE: Get chatbox lines

by mdillon (Priest)
on May 26, 2000 at 20:47 UTC ( #15030=note: print w/replies, xml ) Need Help??


in reply to Get chatbox lines

there's no need to use splice in a void context to trim the cache in your getnewlines sub. just use the following code:
my $CACHE_LIMIT = 50; $#$cache = $CACHE_LIMIT - (1 - $[);

Replies are listed 'Best First'.
RE: RE: Get chatbox lines
by ZZamboni (Curate) on May 26, 2000 at 21:43 UTC
RE: RE: Get chatbox lines
by ZZamboni (Curate) on May 30, 2000 at 23:31 UTC
    The problem with this (now that I have tested it well) is that it enlarges the array when it is originally smaller than the limit. splice doesn't do that. Any ideas? Thanks,

    --ZZamboni

      not besides just appending 'if @$cache > $CACHE_LIMIT';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://15030]
help
Chatterbox?
[james28909]: yep, i am scraping a websites date/time stamp from an article. none of that is relevant though because the strings i get are as expected. the returned data from the website is the list of @weekdays
[james28909]: i need to convert those @weekdays to an numerical date based off of scalar localtime

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-04-29 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.