Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

(ichimunki) Re4: fortune

by ichimunki (Priest)
on Jan 26, 2001 at 16:58 UTC ( #54537=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: fortune
in thread fortune

First, I had trouble with __END__, seemed to work better with __DATA__.

Here is the same thing looking a little more perlish and minus the deprecated FONT tag and BODY attributes and not using header tags to provide large text. Putting style back in using CSS is left as an exercise for the reader.
#!/usr/bin/perl -w use strict; use CGI qw(:standard); my $quip = ""; { $/ = "%%\n"; rand($.) < 1 && chomp( $quip = $_ ) while(<DATA>); $quip = $quip || 'Doomed! No Fortune Found.'; } print header(), start_html( -title => 'Fortune Teller Says...' ), p( $quip ), end_html(); __DATA__

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://54537]
help
Chatterbox?
and the grasshoppers chirp...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2017-10-22 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (273 votes). Check out past polls.

    Notices?