Acme-ButFirst
view release on metacpan or search on metacpan
lib/Acme/ButFirst.pm view on Meta::CPAN
Acme::ButFirst - Do something, but first do something else.
=head1 SYNOPSIS
use Acme::ButFirst;
# Print a greeting, but first find caffiene.
{
print "Good morning!\n";
} but first {
print "I need a coffee\n";
}
# Count from 1 to 10, but first print a statement
# about our counting skills.
foreach my $count (1..10) {
print "$count\n";
} but first {
print "I can count to...";
}
# Print our lines, but first reverse them, but first convert
# them into upper case.
while (<>) {
print;
} butfirst {
$_ = reverse $_;
} butfirst {
$_ = uc $_;
}
=head1 DESCRIPTION
C<Acme::ButFirst> allows you to execute a block of code, but first do
something else. Perfect for when you wish to add to the start
( run in 0.448 second using v1.01-cache-2.11-cpan-de7293f3b23 )