in reply to Re^2: print +split
in thread print +split
Try:
Your code wasn't performing a subtraction. Also, as Roy mentioned the /^\d+/ wasn't matching.
while (<DATA>) { if (/regular files|archdone files/) { local $, = "\n"; s/,//; print +(split)[2], $,; $diff[++$i] = (split)[2]; } } print $diff[1]-$diff[2],"\n"; __DATA__ regular files 62,622 597.488G 641547379187 archdone files 62,535 597.008G 641032761295
Your code wasn't performing a subtraction. Also, as Roy mentioned the /^\d+/ wasn't matching.
In Section
Seekers of Perl Wisdom