Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: random image

by iamcal (Friar)
on Jun 06, 2001 at 11:36 UTC ( [id://86145]=note: print w/replies, xml ) Need Help??


in reply to random image

A brief breakdown:
#!/usr/bin/perl @files=('img1.jpg','img2.jpg','img3.jpg'); $r = rand(4700)%(scalar(@files)); $file = $files[$r]; print "Content-type: image/"; print ((split(/\./,$file)[1]=='jpg')?'jpeg':'gif'); print "\n\n"; if (open(FID,$file)){ while($data = <FID>){ print $data; } close(FID); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-06-17 15:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.