On 1/30/2004 9:45 AM, Jeff 'japhy' Pinyan wrote:

On Jan 30, Randy W. Sims said:


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

"Randy W. Sims" wrote:


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.

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


prints lines 10-20. See the perlop manpage.


Re-read it. Using .. that way ONLY WORKS if its arguments are constants.

You're right. Somehow I've never run across that in the years I've been using perl. I tested with constants and then tried to generalize it in my response without testing. Sorry for the mis-info.


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