[EMAIL PROTECTED] wrote:
> you are correct, you do not need " " around $.
> thank you!
> I was using strict and warnings, but must of had another error.
> I am unfamiliar with the variable $.?  I tried playing with it, but
> was unsuccessful.  I could not find it in cookbook nor in programming
> perl. 
> 
> 
        It contains the current line number read of the current open file that 
you are reading. You do not need to initialize it, just use as if ( $. > 10 ) { 
# then do somehting}else { # do something else}

        Wags ;)
> 
> linect=$.
> linect=1;
>  while ( <FILEHANDLE>) {
>       if ( $linect > 9 ) {
>             do whatever ...
>       }
>  $linect++;
>  }
> 
> 
> Derek B. Smith
> OhioHealth IT
> UNIX / TSM / EDM Teams
> 
> 
> 
> 
> 
>              Jeff 'japhy'
>              Pinyan
>              <[EMAIL PROTECTED]                                       
>              To rg>                       [EMAIL PROTECTED]
>                                                                      
>              cc 02/15/2005 10:38          'Perl Beginners '
>              AM                        <beginners@perl.org>
>                                                                   
>                                        Subject RE: Start reading from
>                                        a specific line
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On Feb 15, [EMAIL PROTECTED] said:
> 
>> my $linect="$.";
>> while ( <FILEHANDLE>) {
>>      if ( $linect > 9 ) {
>>            do whatever ...
>>      }
>> $linect++;
>> }
>> 
>> need to use double-quotes around variable $.
> 
> No you don't.
> 
>    my $linecount = $.;
> 
> works just fine.
> 
> And is there a reason you don't want to use $.?  That is, why create
> another variable which does the same thing?
> 
> --
> Jeff "japhy" Pinyan         %  How can we ever be the sold short or
> RPI Acacia Brother #734     %  the cheated, we who for every service
> http://japhy.perlmonk.org/  %  have long ago been overpaid?
> http://www.perlmonks.org/   %    -- Meister Eckhart
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>



*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


--
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