Changeset 99cc3dc for perl


Ignore:
Timestamp:
Oct 18, 2009, 1:35:29 PM (15 years ago)
Author:
Karl Ramm <kcr@1ts.org>
Branches:
master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
a957e92
Parents:
6ea3890
Message:
Revert "Add a zephyr randomizer as an alternative to default_zephyr_signature()"

This reverts commit f816ff1bcc839eb7c77fe93185f279da47f3473e.

That code was clearly wrong.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl.pm

    rf816ff1 r99cc3dc  
    447447}
    448448
    449 =head3 random_zephyr_siganture
    450 
    451 Pick a random zephyr signature.
    452 
    453 =head3 reload_zephyr_signatures
    454 
    455 Reload the random zephyr signatures
    456 
    457 =head3 $random_zsig_separator
    458 
    459 What to split the zsigs on
    460 
    461 =cut
    462 
    463 our $random_zsig_separator='\n';
    464 
    465 {
    466   my $zsigs;
    467 
    468   sub reload_zephyr_signatures {
    469     my $slurp;
    470 
    471     srand;
    472 
    473     if (open(ZSIGS, "$ENV{'HOME'}/.zsigs")) {
    474       {
    475         local $/ = undef;
    476         $slurp = <ZSIGS>;
    477       }
    478       $zsigs = [split(/$random_zsig_separator/, $slurp)];
    479     } else {
    480       $zsigs = [default_zephyr_signature()];
    481     }
    482   }
    483 
    484   sub random_zephyr_signature {
    485     if (!defined($zsigs)) {
    486       reload_zephyr_signatures();
    487     }
    488     return $zsigs->[int(rand($#{$zsigs}))];
    489   }
    490 }
    491 
    492449# Stub for owl::startup / BarnOwl::startup, so it isn't bound to the
    493450# startup command. This may be redefined in a user's configfile.
Note: See TracChangeset for help on using the changeset viewer.