perl and file and cat

Hi All

i need a little script that can open a file , read it and then spit out some information from it

from the shell i would do

cat /var/log/Xorg.0.log | grep  pixel | sed 's/: 330.*//' |

how can i do this nicley in perl

thanks

Adam

 
perl -lane 'print if $_ =~ m/pixel/ && $_ =~ s/: 330.*//;' /var/log/Xorg.0.log

More "perlish":

perl -lne '/pixel/ && s/: 330.*// && print' 

sorry got my sed round the wrong way, it should be

cat /var/log/Xorg.0.log | grep  pixel | sed 's/.*NVIDIA(0): //'