I have the output of a backquoted command i.e.
$result=`cat $file | anotherscript.pl`;
Does a backquoted command automatically get output to stdout as well as into the string $result?
My question is this: The output looks like:
Script version 1.7
12345 hashes read from
1 database
3 read, 2 found, 2 written
ID123 ZZ00000077
ID456 ZZ00000012
ID124 NONE
What i would like to do is build up a hash of the found items i.e with IDnnn as the key and the ZZ identifier as value. I would also like a hash/array of any NONE found items again with IDnnn as key and NONE as value or if array, just IDnnn pushed onto it.
I dont particularly want the output of the command output to stdout either
I have tried a regular expression to get at the NONE lines such as :
@res = split /\n/, $result; foreach $element (@res){ if ($element=~/(.*NONE)$/m){ push @none, $element; } }
Any help would be appreciated.
Thanks
Joe
In reply to Regular Expression and backquoted cmds by joec_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |