- or download this
$"=q;grep;;$,=q"grep";for(`find . -name ".saves*~"`){s;$/;;;/(.*-(\d+)
+-.*)$/;
$_=["ps -e -o pid | "," $2 | "," -v "," "];`@$_`?{print"+ $1"}:{print"
+- $1"}&&`r
m $1`;
print$\;}
- or download this
$"=q;
...
`@$_` ? {print"+ $1"} : {print"- $1"} && `rm $1`;
print $\;
}
- or download this
1: $"=q;
2:
...
9: `@$_` ? {print"+ $1"} : {print"- $1"} && `rm $1`;
10: print $\;
11: }
- or download this
perl -e '@a = qw (a bc def); print "before: @a\n"; $"=q; print "after:
+ @a\n";'
Output:
before: a bc def
- or download this
perl -MO=Deparse -e '@a = qw (a bc def); print "before: @a\n"; $"=q; p
+rint
"after: @a\n";'
...
print "before: @a\n"; # yep, still with ya
$" = ' print "after: @a\\n"'; # whoa, this is unexpected
-e syntax OK # good news, I guess
- or download this
$"=q;grep;;
$,=q"grep";
- or download this
$" = 'grep';
$, = 'grep';
- or download this
1: $"= 'grep' ;
2: $,= 'grep' ;
...
8: `@$_` ? {print"+ $1"} : {print"- $1"} && `rm $1`;
9: print $\;
10: }
- or download this
/ # start of pattern match
( # begin storing into $1
...
) # stop storing into $2
$ # end of the line, bub
/x; # / to terminate regex, x to allow comments
- or download this
@command = "ps -e -o pid | grep $2 | grep -v grep ";
$ar_command = \@command;
- or download this
perl -e '$foo = 0; $foo==0 ? print "foo is zero" : print "foo is non-z
+ero";'
Output:
foo is zero
- or download this
$foo = 0;
if ( $foo == 0 ) {
...
} else {
print "foo is non-zero" ;
}
- or download this
if ( `@$_` ) {
print "+ $1";
} else {
print "- $1" && `rm $1`;
}
- or download this
my $owner_is_still_running = `@$_`; # search for a specifi
+c $pid
if ( $owner_is_still_running ) {
...
print "removing $1"; # didn't find $pid
`rm $1`; # remove $pid's tempfi
+le
}
- or download this
#!/usr/bin/perl
...
`rm $filename`;
}
}