dallok has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (strings)
I have two strings $zero_arg and $sec_arg.
I wish to compare each one against a file (routers.txt and
interfaceses.txt) respectively. If $zero_arg is a good name
then I want it to check the interface name. If $zero_arg is
not a good name then DIE.
This is how I have the checking so far. Can I AND two if statements? Such as:
Is there some way to make this work like that?if (grep { $_ eq $zero_arg} @ARRAY) && {$_ ne $sec_arg} @anotherarray) + #Then do command.
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I compare two strings against two arrays respectively?⭐
by Russ (Deacon) on Nov 04, 2000 at 20:42 UTC | |
Re: HOw do I compare two strings against to arrays respectively
by Adam (Vicar) on Nov 03, 2000 at 23:30 UTC | |
Re: HOw do I compare two strings against to arrays respectively
by quidity (Pilgrim) on Nov 04, 2000 at 00:36 UTC | |
Re: HOw do I compare two strings against to arrays respectively
by Fastolfe (Vicar) on Nov 04, 2000 at 01:27 UTC | |
by Fastolfe (Vicar) on Nov 04, 2000 at 01:28 UTC | |
Re: HOw do I compare two strings against to arrays respectively
by runrig (Abbot) on Nov 04, 2000 at 00:39 UTC | |
by runrig (Abbot) on Nov 04, 2000 at 00:44 UTC | |
Re: How do I compare two strings against two arrays respectively?
by ariels (Curate) on Mar 27, 2001 at 17:43 UTC |
Back to
Seekers of Perl Wisdom