in reply to Re: grab 'n' lines from a file above and below a /match/
in thread grab 'n' lines from a file above and below a /match/

Hey, On a lighter note - I now realize that I was operating on $_ and trying to play with $., what I dont understand is where would I use $. -> any typical situations where $. might come in handy
you might find this to be a newbie question, but I am still learning perl and am just curious.
thanks again
  • Comment on Re^2: grab 'n' lines from a file above and below a /match/

Replies are listed 'Best First'.
Re^3: grab 'n' lines from a file above and below a /match/
by Aristotle (Chancellor) on Sep 16, 2004 at 23:40 UTC

    $. is just the number of the last line read from the last accessed filehandle. It's useful any time you want to know the line number. It does nothing beyond that; in particular, writing to it has no effect at all, other than that its value changes.

    Makeshifts last the longest.