Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: font color="#ff0000"IF NOT! IF NOT!/font

by twerq (Deacon)
on Aug 02, 2001 at 22:48 UTC ( #101743=note: print w/replies, xml ) Need Help??


in reply to IF NOT! IF NOT!

using perl regular expressions, try:
foreach my $word (@words) { print "$word\n" if ($word =~ /home/); }


--twerq

Replies are listed 'Best First'.
Re: Re: font color="#ff0000"IF NOT! IF NOT!/font
by myocom (Deacon) on Aug 02, 2001 at 22:51 UTC

    ...except that you got the logic backwards.

    I need an if statement to say something like "if grep can't find 'home' in a word, print the word."
    foreach (@words) { print "$_\n" unless /home/; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2022-06-25 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (82 votes). Check out past polls.

    Notices?