home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
- From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
- Subject: Re: Help on string match!
- Message-ID: <mcook.724724305@fendahl.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: fendahl.dev.cdx.mot.com
- Organization: Motorola Codex, Canton, Massachusetts
- References: <lj4fcsINN1lu@exodus.Eng.Sun.COM>
- Distribution: na
- Date: Sat, 19 Dec 1992 00:18:25 GMT
- Lines: 31
-
- tesh@cleo.Eng.Sun.COM (Teshager Tesfaye) writes:
-
- [...]
-
- > foreach $a_name ( @A_array ) {
- > for(;;) {
-
- > if( $_ =~ "^ +[JKD]FF" ) {
- > local($macname,$fname_net,$other) = split(' ',$_,3);
-
- > -------> if ( $a_name eq $flop_name ) {
-
- [...]
-
- >I am having with the string match on the line that I show. Although I know
- >that $a_name and $flop_name are identical strings this string match "ALWAYS"
- >fails. Am I doing something wrong? Is there a better way to go about this
- >problem.
-
- If you've taken logical steps and reached an illogical conclusion, then one of
- your assumptions must have been invalid.
-
- How is it that you know that $a_name and $flop_name are identical? How is it
- that you know that the comparison is being made? ...that the comparison is
- failing?
-
- Some strategically-placed print statements will tell you what is going on.
- Don't forget to allow for trailing whitespace and non-printing characters
- (consider piping your script's output through "cat -ve", or somesuch).
-
- Michael.
-