in reply to Putting files in an Array

but encountering some problem with the logic
Can you specify what problem you are having?

Since none of the lines of your text file have the string "head", you are not pushing any of those lines into your array. Try this:

use warnings; use strict; @ARGV = 'Google_1'; my @results; while (<ARGV>) { chomp $_; push( @results, $_ ); } print "@results\n";