Skip to content

Commit

Permalink
Perl: print quotes at the end of the file, but use BEGIN
Browse files Browse the repository at this point in the history
  • Loading branch information
avar committed Sep 23, 2010
1 parent d592129 commit 64aa737
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/App/QuoteCC/Output/Perl.pm
Expand Up @@ -83,12 +83,13 @@ __DATA__
__[ program ]__ __[ program ]__
#!/usr/bin/env perl #!/usr/bin/env perl
our @QUOTES = ([% FOREACH quote IN quotes %]<<'----[% loop.count %]----8========D',[% END %]);
[% FOREACH quote IN quotes %][% quote %]
----[% loop.count %]----8========D
[% END %]
if (@ARGV && $ARGV[0] eq '--all') { if (@ARGV && $ARGV[0] eq '--all') {
print for @QUOTES; print for @QUOTES;
} else { } else {
print $QUOTES[rand @QUOTES]; print $QUOTES[rand @QUOTES];
} }
BEGIN { our @QUOTES = ([% FOREACH quote IN quotes %]<<'----[% loop.count %]----8========D',[% END %]); }
[% FOREACH quote IN quotes %][% quote %]
----[% loop.count %]----8========D[% UNLESS loop.last %]
[% END %][% END %]

0 comments on commit 64aa737

Please sign in to comment.