How about splitting the line.

@lines = ("foo=bar # stuff", "bar=foo # more stuff");

foreach (@lines) {
        my ($line) = split(/\s*#/);
        print "$line\n";
}

John

-----Original Message-----
From: Yacketta, Ronald [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2002 17:45
To: Beginners (E-mail)
Subject: excluding comments in a line


Folks,

I am reading in a .cfg file and exclude comments (#) and spaces at the
beginning of the line
how would I lop off any comments in a line?

IE:

Key "value" # comment here


Regards,
Ron

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


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



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

Reply via email to