in reply to one line perl code

perldoc perlrun, particularly the -s option. </p.

If things get too fancy - write a real script instead of a oneliner.