http://www.perlmonks.org?node_id=918313


in reply to grep return the entire file not the line which matches

Check your syntax on the grep command as well. It should probably be:
@data=grep /$en/,@eng_dat;

Replies are listed 'Best First'.
Re^2: grep return the entire file not the line which matches
by Anonymous Monk on Aug 10, 2011 at 12:35 UTC
    This is the correct. The syntax would be:
    @data=grep /$en/,@eng_dat;
    or it can be equivalently:
    @data=grep (/$en/,@eng_dat);
    as mentioned here: http://programmingbulls.com/perl-grep