in reply to printing the line after grepping

@error1=(grep {/0 Items in Feed & 0 New Fetched items/} <FILE>); if(@error1) { print "match found (@error1)"; } else { print"nothing"; +}
this approach is quite dangerous, as it reads whole FILE before grep-ing. Try to use while

Replies are listed 'Best First'.
Re^2: printing the line after grepping
by rajyalakshmi (Acolyte) on Nov 11, 2009 at 14:01 UTC
    thats fine..but how do i print the line where the characters i grepped was found.I am new to perl scripting
      That's what the code he posted does!?
      oh yeah..!!!thank u so much