in reply to Re^2: how to extract certain lines
in thread how to extract certain lines

Thank you Neil..
I still have questions here.
Why do you use my before $line
what is the function of my here?
Thank you

Replies are listed 'Best First'.
Re^4: how to extract certain lines
by neilh (Pilgrim) on Oct 26, 2004 at 05:00 UTC
    Hi dee00zee,
    The my puts the variable into scope within the while loop.
    For information have a look at perldoc perlintro and the discussion on lexical scope.

    Neil

Re^4: how to extract certain lines
by Kalaspuff (Beadle) on Oct 26, 2004 at 11:12 UTC
    my is used to declare and assign the variable $line. If you would 'use strict;' this is a requirement for the script to run.

    Manual for my: http://www.perl.com/doc/manual/html/pod/perlfunc/my.html

    Edit: Excuse me for this post, I somehow missed that the question was already answered.