PERL   27

quickie pl

Guest on 17th May 2022 01:21:38 AM

  1. while (<>) {
  2.   @a = split (/\|/);
  3.   foreach $n (0 .. $#a) {
  4.     if (length($a[$n]) > length($b[$n])) {
  5.       $b[$n] = $a[$n];
  6.     }
  7.   }
  8. }
  9. foreach $a (@b) {
  10.   print "$a\n";
  11. }

Raw Paste


Login or Register to edit or fork this paste. It's free.