#!/usr/bin/perl # # randomquote v0.0.2 - Outputs random quote from text file # Copyright (C) 2005, 2009 Stian Skjæveland # # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # use CGI qw(:standard); use strict; print header; my ($int_lines, $data1, $data2, @lines); my $quotefile="/home/stunix/domains/atlantiscrew.net/public_html/stian/doc/quotes"; my $randint=int(rand(10)); open(QUOTEFILE, "$quotefile") || die("$0: can't open $quotefile: $!\n"); @lines=; close(QUOTEFILE); ($data1, $data2)=split('/', $lines[$randint-1]); print "$data1 $data2";