[TriLUG] Perl question. . .

Scott Lambdin lopaki at gmail.com
Tue Feb 17 15:54:04 EST 2009


yeah, but you are wasting a lot of cpu with all the decrementing.
(snicker)  How about


#!/edi/perl/bin/perl
my $pick = shift;

while(<>) {
       if($pick == $.) {
               print $_;
               exit(0);
       }
}



On 2/17/09, Brian Henning <Brian.Henning at datadirect.com> wrote:
>
> Bollocks!  Right you are.
>
>
> Michael Peters wrote:
>
> >Brian Henning wrote:
> >> I think what you really meant was this:
> >
> >>      if($pick-- == 0) {
> >
> >Shift that to "--$pick == 0" and yes :)
> >
> >> ...which is of course what I really meant the first time..  :-)
>
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
>



-- 
There's a box?



More information about the TriLUG mailing list