Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

quotes from the great master

by sh1tn (Priest)
on Jul 02, 2006 at 13:35 UTC ( [id://558848]=CUFP: print w/replies, xml ) Need Help??

# random Larry Wall quote # quotes can be taken from: # http://www.perl.com/CPAN/misc/lwall-quotes.txt.gz # Sun Jul 2 15:25:40 use File::Slurp; $_ = read_file(q{lwall-quotes.txt}); $quote = []; push @$quote, $2 while /(\%\%)(.+?)\1/gs; print $quote->[rand(@$quote)], $/


Replies are listed 'Best First'.
Re: quotes from the great master
by merlyn (Sage) on Jul 02, 2006 at 15:27 UTC
    use HTTP::Cache::Transparent (); use LWP::Simple qw(get); use Compress::Zlib (); HTTP::Cache::Transparent::init({BasePath => "/tmp/http-cache-transpare +nt-$>"}); my $gzipped = get "http://www.perl.com/CPAN/misc/lwall-quotes.txt.gz"; my $quotes = Compress::Zlib::memGunzip($gzipped); my @quotes = split /\n%%\n/, $quotes; print $quotes[rand @quotes], "\n";
    There. Automatic fetching and caching. HTTP::Cache::Transparent is a wonderful thing.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Splendid way! ++


      That's not cool...
      That's close to 0 dgK
      F*Freeeeezing++

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://558848]
Approved by Hue-Bond
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2026-05-13 22:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.