Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Print while filtering ouput...

by Lawliet (Curate)
on Feb 26, 2009 at 02:24 UTC ( #746423=note: print w/ replies, xml ) Need Help??

in reply to Print while filtering ouput...

Easy peasy, just print the line unless $lines =~ /\//; :)

And you didn't even know bears could type.

Comment on Re: Print while filtering ouput...
Download Code
Replies are listed 'Best First'.
Re^2: Print while filtering ouput...
by Anonymous Monk on Feb 26, 2009 at 03:13 UTC
    Whew! Easy peasy for you oh wise one!
    open (OUTFILE, ">>c:\/perl\/project\/archive.txt"); print OUTFILE "$lines" unless $lines =~ /\//; #works! thanks Lawliet! close OUTFILE;
    Many thanks! I feel much better since i stopped banging my head against all those perl books.
    Your humble and grateful servant,

      Wow, I may have to start helping more people if this is the response I get! Thank you for the laud (is 'laud' use correctly there?) but I must say that ikegami's reply humbles even the great Lawliet. A one-liner that can replace your whole program!

      Of course, one could say that I realized your lack of expertise in the matter and suggested a solution that you can grasp and therefore learn; expanding your knowledge of Perl and enabling you to teach others. In that case, you would be completely correct in thanking me and citing me in your program. :)

      Also, note that it was I who bravely /msg'd ikegami to inform him of his lack-of-negation in his original node.

      And now back to my normal, un-self-centered life. I am not that egotistical in real life, by the way. I really have no reason to be :P

      And you didn't even know bears could type.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://746423]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-11-28 09:09 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (740 votes), past polls