#!/usr/bin/perl -w open(FICH, "a.txt"); while () { print if /string1/../string2/ ; } close FICH;