On Mon, 2006-10-09 at 16:24 +0530, positive mind wrote:
> Greetings !!
> 
> i am beginer in Perl and have task in hand to do..i got to read lot of
> variables and parameters which are defined in one file. I have to use these
> variables in my perl script ..how do i do this...(how do i use the variables
> in one file in my perl script...)
> 
> thnx,
> pm

How about:

    while( <$parm> ) {

        s/\r//g;

        s/\s*#.*//; # Strip comments.

        next if( /^\s*$/ );  ## skip blank lines

        chomp;
        ($key,$value) = split(/=/,$_,2);

        $ref->{$key} = $value;
    }




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