system("pvscan>>pv.txt1"); open my $FH,"pv.txt1" or die "Cannot open file: $!";
I see that you append to the pv.txt1 file which means more lines to parse every time you run the script; is this actually intended? Unless you want to keep the output of pvscan hanging around you can open a file handle directly on piped commands. Something like:-
open my $pvscanFH, '-|', 'pvscan' or die "Cannot fork pvscan: $!\n";
You can then read the command output line by line just as if it was a file on disk.
I hope this is helpful.
Cheers,
JohnGG
In reply to Re^3: Text filer and assign
by johngg
in thread Text filer and assign
by intoperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |