#!/usr/bin/env perl use warnings; use strict; my $sigfile = "$ENV{HOME}/.zsigs"; my @sigs; open(SIGS, "<", $sigfile) or exit; @sigs = grep {!/^\s*(#|$)/} ; chomp(@sigs); close(SIGS); print $sigs[int(rand @sigs)];