On 01/30/04 03:59, John W. Krahn wrote:
"Randy W. Sims" wrote:

On 1/27/2004 9:55 PM, Trina Espinoza wrote:


So this may be wishful thinking, but I would be kicking myself later
if I didn't ask. Is there a function in perl where you give the function
exact line numbers and it would only read the data in the range of lines
you gave it? My other alternative would be using a counter to find a
start line and an end line in a file. Doable but painful. Let me know if
there is any hope . . .

while (<>) { if ( $start_line .. $end_line ) {


That will be true if $start_line is true and false if $start_line is
false.  The value in $end_line is irrelevant.


John

perl -lne 'print if 10..20' some_file


prints lines 10-20. See the perlop manpage.

Regards,
Randy.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to