Skip to content

Instantly share code, notes, and snippets.

@savonarola
Created April 10, 2009 06:53
Show Gist options
  • Save savonarola/92975 to your computer and use it in GitHub Desktop.
Save savonarola/92975 to your computer and use it in GitHub Desktop.
#pp
#!/usr/bin/perl
use Data::Dumper;
no strict;
no warnings "all";
$cmd = shift @ARGV;
while(<>) {
chomp;
print( $_, "\n" ) if eval $cmd;
}
#pmp
#!/usr/bin/perl
use Data::Dumper;
no strict;
no warnings "all";
$cmd = shift @ARGV;
while(<>) {
chomp;
my $res = eval $cmd;
chomp $res;
print( $res, "\n" ) if defined $res;
}
#pgr
#!/usr/bin/perl
use Data::Dumper;
no strict;
no warnings "all";
$cmd = shift @ARGV;
while(<STDIN>) {
chomp;
eval $cmd;
chomp;
print( $_, "\n" ) if defined;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment