in reply to Re: Print while filtering ouput...
in thread Print while filtering ouput...

Thanks for the rapid response to my question but I couldn't determine how to apply your suggestion to my code.
How would you apply your suggested solution to the line
print OUTFILE "$lines";
I tried Lawliet's suggestion as follows and it worked great.
print OUTFILE "$lines" unless $lines =~ /\//;
Your suggested syntax exceeded my tiny brain's ability to compile.
Warmest regards,
Generator

Replies are listed 'Best First'.
Re^3: Print while filtering ouput...
by ikegami (Patriarch) on Feb 26, 2009 at 03:33 UTC

    I couldn't determine how to apply your suggestion to my code.

    It's a replacement for your code. Replace infile and outfile with the name of your files.

    -ne"print if !m{/}" expands to

    while (<>) { print if !m{/} }

    And that's all the code you need to do what you asked.