- Timestamp:
- Sep 25, 2010, 5:58:38 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- c8d9f84
- Parents:
- 118c919
- git-author:
- Kevin Riggle <kevinr@free-dissociation.com> (09/21/10 00:33:56)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (09/25/10 17:58:38)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl.pm
r675a998 rb120bd3 561 561 } 562 562 563 =head3 random_zephyr_signature 564 565 Retrieve a random line from ~/.zsigs (except those beginning with '#') 566 and use it as the zephyr signature. 567 568 =cut 569 570 sub random_zephyr_signature 571 { 572 my $zsigfile = "$ENV{'HOME'}/.zsigs"; 573 open my $file, '<', $zsigfile or die "Error opening file $zsigfile: $!"; 574 my @lines = grep !(/^#/ || /^\s*$/), <$file>; 575 close $file; 576 return '' if !@lines; 577 my $zsig = "$lines[int(rand(scalar @lines))]"; 578 chomp $zsig; 579 return $zsig; 580 } 581 563 582 # Stub for owl::startup / BarnOwl::startup, so it isn't bound to the 564 583 # startup command. This may be redefined in a user's configfile.
Note: See TracChangeset
for help on using the changeset viewer.