in reply to Remove a line from a file using perl one liner

Look in perlrun for the -i, -e, and -n command line switches. Using these two switches and the logic from your code above, the problem is pretty easy to solve.

perl -i -ne'print unless /Alias/ and /icons/;' one.txt

Update: as Bloodnok points out, this could be considered dangerous. A safer version is:

perl -i.bak -ne'print unless /Alias/ and /icons/;' one.txt

which leaves the original as one.txt.bak.

G. Wade