in reply to how to extract script output in new text file ?

...What I want is just to get these results to be saved in a new text file. ..
That can easily be done by printing your desired output to a file filehandle, you have opened like so:

use strict; use warnings; # please note the 'sign' ">" open( my $fh, ">", "output_file.txt" ) or die "cannot open output_file +. +txt$!"; open( my $file, "<", "/file.txt" ) or die "cannot open < file.txt $!"; while (<$file>) { unless (/^A/) { # please note "$fh" filehandle to write to print $fh $_; } } close $file or die $!; close $fh or die $!;

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me