Skip to content

Commit

Permalink
Remove given/when in ps
Browse files Browse the repository at this point in the history
  • Loading branch information
lotrfan authored and Jeff Eklund committed Aug 22, 2013
1 parent 8011cef commit df17d5c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/ps
Expand Up @@ -58,11 +58,12 @@ sub cpu {

sub nice {
mark qr{\S+} => sub {
given (shift) {
when ( $_ > 10 ) { return 'green bold' }
when ( $_ > 0 ) { return 'green' }
when ( $_ < 0 ) { return 'red' }
when ( $_ < -10 ) { return 'red bold' }
do {
$_ = shift;
if ( $_ > 10 ) { return 'green bold' }
if ( $_ > 0 ) { return 'green' }
if ( $_ < 0 ) { return 'red' }
if ( $_ < -10 ) { return 'red bold' }
}
};
}
Expand Down

0 comments on commit df17d5c

Please sign in to comment.