home *** CD-ROM | disk | FTP | other *** search
- From: okamoto@hpcc01.corp.hp.com (Jeff Okamoto)
- Date: Sat, 19 Dec 1992 01:59:30 GMT
- Subject: Problem with study and /o on 4.035 and 4.019
- Message-ID: <1180034@hpcc01.corp.hp.com>
- Organization: An-Pan Man Headquarters
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!apollo.hp.com!cupnews0.cup.hp.com!hpscit.sc.hp.com!hplextra!hpcc05!hpcc01!okamoto
- Newsgroups: comp.lang.perl
- Lines: 28
-
- Here's a strange error that occurs in both 4.019 and 4.035, but works properly
- on 4.010.
-
- $pat = "test";
-
- while ( <> ) {
- study;
- if ( /$pat/o ) {
- print "Found pattern\n" ;
- } else {
- print "Didnt find\n";
- }
- }
-
- If the input to this program is "test", "test" on two lines, 010 will
- correctly report it was found twice, but 019 and 035 will say it wasn't
- found on the second try.
-
- Removing the call to study, or the /o trailer will solve the problem for
- both 019 and 035. Am I just doing something stupid? Granted, the study
- is pretty useless in this case, but I think the script should still work.
- --
- \ oo The New Number Who,
- \____|\mm Jeff Okamoto
- //_//\ \_\ HP Corporate Computing & Services
- /K-9/ \/_/ okamoto@ranma.corp.hp.com
- /___/_____\
- ----------- (415) 857-6236
-