fork download
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. while (my $line = <>) {
  7. chomp($line);
  8.  
  9. if ($line =~ /(?:\d{2,}.\d|[5-9].\d|4.[1-9]) inches/) {
  10. print qq/[> 4.0"]: $line\n/;
  11. } else {
  12. print qq/[<= 4.0"]: $line\n/;
  13. }
  14. }
  15.  
Success #stdin #stdout 0s 4616KB
stdin
5.4 inches
12.6 inches
1.2 inches
10.5 inches
4.0 inches
stdout
[>  4.0"]: 5.4 inches
[>  4.0"]: 12.6 inches
[<= 4.0"]: 1.2 inches
[>  4.0"]: 10.5 inches
[<= 4.0"]: 4.0 inches