#!/usr/bin/perl $percent = shift; while($line = ) { $old = $new; @array = split(/\,/, $line); $new = $array[4]; if($old != 0) { $calc = ($new / $old) - 1; if(abs($calc) >= $percent) { print "$calc\n"; } } }