in reply to Re^2: problems with pattern match
in thread SOLVED:problems with pattern match

[...] I tried but it doesn't work...It only print legami idrofobici: legami idrogeno: so the script runs but it doesn't do what I want.

... open (IN, "</home/nerone/Desktop/lig/1xmj.pl") || die "impossibile apr +ire il file"; my ( @hydrophobic , @residue ); while ( my $r = <DATA> ) { ... }

I used DATA file handle so that portion of your own input could be appended to the program itself to form self contained example. Given your changes, the program expectedly did not print anything. Please read about open function and DATA file handle (under "Special Literals" subsection).

You need to replace DATA file handle with IN (not the other way around) and try again.

After seeing "SOLVED" & posted code in OP: emphasised the replacement & added parenthetical clarification for good measure. *sigh*