my $call = `mminfo -r 'volume,state,written,%used,space,pool,location,ssinsert' -q 'ssinsert <= three week ago`; foreach ($call) { if ( $call =~ /Daily\S+\s/) { print "Daily true $_ .\n"; } else { print "not found\n "; } } #### my @calls = split /\r?\n/, `mminfo -r 'volume,state,written,%used,space,pool,location,ssinsert' -q 'ssinsert <= three week ago`; foreach $call (@calls) { if ( $call =~ /Daily\S+\s/) { print "Daily true $call .\n"; } else { print "not found\n "; } } #### my $cmd = 'mminfo -r 'volume,state,written,%used,space,pool,location,ssinsert' -q 'ssinsert <= three week ago'; open CMD, "$cmd |" or die "Can't run '$cmd': $!\n"; while () { if (/Daily\S+\s/) { print "Daily true $_"; } else { print "not found\n "; } } #### if (/Daily(\S+)\s/) { print "Daily true $1\n"; }