Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Shaji Kalidasan
Dear Perlers, I am trying to print the matching lines using __DATA__ filehandle and for the very first time it prints the desired lines, but as soon as I rewind it using seek, it is printing lines from the very beginning which is not the desired result (as it prints from the start). I want to

Re: Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Jim Gibson
On Oct 25, 2013, at 4:46 PM, Shaji Kalidasan wrote: Dear Perlers, I am trying to print the matching lines using __DATA__ filehandle and for the very first time it prints the desired lines, but as soon as I rewind it using seek, it is printing lines from the very beginning which is not

Re: Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Paul Johnson
On Fri, Oct 25, 2013 at 05:14:23PM -0700, Jim Gibson wrote: On Oct 25, 2013, at 4:46 PM, Shaji Kalidasan wrote: Dear Perlers, I am trying to print the matching lines using __DATA__ filehandle and for the very first time it prints the desired lines, but as soon as I rewind it

Re: Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Shaji Kalidasan
Dear Jim, Awesome, thanks a bunch for your detailed explanation. It works like a champ.   best, Shaji --- Your talent is God's gift to you. What you do with it is your gift back to God.

Re: Problem rewinding the __DATA__ filehandle

2013-10-25 Thread John W. Krahn
Jim Gibson wrote: On Oct 25, 2013, at 4:46 PM, Shaji Kalidasan wrote: Dear Perlers, I am trying to print the matching lines using __DATA__ filehandle and for the very first time it prints the desired lines, but as soon as I rewind it using seek, it is printing lines from the very beginning

Re: Problem rewinding the __DATA__ filehandle

2013-10-25 Thread Shaji Kalidasan
Dear Paul, Many thanks for your explanation on Approach 3 Here is the working code Courtesy :  1) Jim Gibson (For Approach 1 and 2) 2) Paul Johnson (For Approach 3) 3) John W Krahn (I figured it out myself, thanks for emphasizing the fact to greater audience) [code] use strict; use warnings;