- Timestamp:
- Oct 18, 2009, 1:35:29 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- a957e92
- Parents:
- 6ea3890
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl.pm
rf816ff1 r99cc3dc 447 447 } 448 448 449 =head3 random_zephyr_siganture450 451 Pick a random zephyr signature.452 453 =head3 reload_zephyr_signatures454 455 Reload the random zephyr signatures456 457 =head3 $random_zsig_separator458 459 What to split the zsigs on460 461 =cut462 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 492 449 # Stub for owl::startup / BarnOwl::startup, so it isn't bound to the 493 450 # startup command. This may be redefined in a user's configfile.
Note: See TracChangeset
for help on using the changeset viewer.