In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Rob Dixon) writes:
>Peter Scott wrote:
>> Anyway, here's a way that doesn't require keeping more than 12 lines
>> in memory and doesn't require reading twice:
>>
>> $^I = ".bak";
>> my @queue;
>> while (<>) {
>>   push @queue, $_;
>>   print shift @queue if @queue > 12;
>> }
>
>Neat. I like that :)
>
>What's the $^I variable? Is it a 5.8 addition?

No, it's a 4.0 addition (or earlier).  It's how to turn on the -i command-line
switch within code.  See -i in the perlrun page.

-- 
Peter Scott
Perl classes in Los Angeles: http://www.psdt.com/services/classes/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to