Does anyone know how to ignore the rest of a line in Perl? I am reading a file and printing out tokens to an output file. I want to ignore the rest of a line after a colon is found, which indicates a comment. That way it will not print to the output file. I tried a range from (; - \n) but it does not work. Thanks for any input.
tat2dlady
0
Light Poster
Recommended Answers
Jump to PostMy personal suggestion, would be to do a split or regex on it. I would do a split, but I'm a bit silly. The thing is, if a colon starts a comment, then there can be no colon's within the "good string". what I mean is, if the line has:
…
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.