in reply to Signature rotation.
$/ = "%";
Why not "\n%\n"?
Oh, and just because I like Tie::File and strict, and dislike using /dev/urandom, here's an alternative implementation:
#!/usr/bin/perl -w use Tie::File; use IO::File; use Fcntl qw(O_RDONLY); use strict; chdir '/home/hagus'; tie my @fortunes, 'Tie::File', '.signatures.rot', mode => O_RDONLY, re +csep => "\n%\n"; IO::File->new('.signature', 'w')->print($fortunes[rand @fortunes]);
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Signature rotation.
by hagus (Monk) on May 23, 2002 at 07:35 UTC |