All,
Hello,
Here is my code: use strict; use warnings; my $dev = qw/original1/; my $dev1 = qw/clinical1/;
Why are you creating a list and then assigning it to a scalar?
my $fout = qq(/usr/local/log/fuji.out);
Why use double quotes on a string that has nothing to interpolate?
open (OUT, "+>$fout") || die "unable to open file: $fout $!";
open (FOO, "samcmd a $dev 2>\&1 |" ) || die "unable to open pipe...
$!";
while (<FOO>) {
if (/regular files/ or /archdone files/) {
my $diff=0;
local $, = "\n";
s/,//;
print +(split)[2], $,, $diff-=$1;
Since $diff is always 0 then "$diff -= $1" is the same as "$diff = 0 - $1"
which is the same as "$diff = -$1". Since $1 doesn't appear to be set anywhere perhaps you meant:
print +(split)[2], $,, ($diff = -(split)[1]);
}
and it prints w/out the $diff code
62622
62535
WITH the $diff code it is NOT subtracting the two numbers which is what I need.
I think the problem is $_ contains data from the original app command which is
regular files 62,622 597.488G 641547379187 archdone files 62,535 597.008G 641032761295
and so I am saying subtract what is in field 1 , well field 1 is empty, but why????
John -- use Perl; program fulfillment
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
