This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: cygwin-perl: matching behaves weird


Guys,

Thank you all for your replies. Just to let you know that I figured out what 
the problem was, and (surprise-surprise) it had nothing to do with perl or 
cygwin at all.

It was the source string. What I'm doing is making a Perl socket server process 
parts of an html document pased by a client (parts are passed). I have several 
versions of client, for different platforms. Well, after I switched from 
ActiveState perl to Cygwin perl I also started testing another client (a BHO 
for Internet Explorer). Since it does the same stuff the old client did, and by 
the looks of it delivers what it should, I didn't suspect it. What it does is 
simply pass a part of the BODY content to the server. But, for some strange 
reason, IE completely changes the HTML source of the document while loading it 
in it's (IE's) DOM. So, the body I would retreive was not the same as the one 
in the HTML source. (::anoyed;)

Just to mention for the record: the reason to switch from the ActiveState Perl 
to the Cygwin Perl was that the Active's "fork" stoped working after I 
installed the SP2 for XP.

Quoting Igor Pechtchanski <pechtcha@cs.nyu.edu>:

> Good guess, but the original RE didn't support any variations of 
> whitespace, so it wouldn't have matched a multi-line string anyway...  
> However, if the OP didn't provide the exact RE he used, he could try 
> setting PERLIO=crlf in his environment and see if that helps.
> 
> One thing that he may also be missing is that the '/s' flag will retain
> 
> all the characters, even though it runs the RE over one string, so that
> 
> string may (and usually will) contain newlines, which have to be
> accounted 
> for in the RE.
> 	Igor
> P.S. Oh, and <http://cygwin.com/acronyms/#PCYMTNQREAIYR>, even the list
> 
> address.  Thanks.
> 
> On Wed, 18 Aug 2004, Wardman_Michael wrote:
> 
> > I wonder if the "/s" on the end is getting a newline problem
> somewhere?
> > 
> > This might explain the Windows vs. Cygwin behaviour, as they can be
> > configured to have different line endings.
> > 
> > I've had to modify a lot of scripts to run under Cygwin by adding:
> > xxxx | tr -d '\r'
> > 
> > -----Original Message-----
> > From: V.xxxxx@xxxxx.xx.xx
> > Sent: Wednesday, 18 August 2004 11:49
> > To: cygwin@xxxxxx.xxx
> > Subject: cygwin-perl: matching behaves weird
> > 
> > Now, this may be old news for many of you, but I'm new to cygwin, so
> please 
> > don't shoot. I'd be happy if someone would post me a link to the
> solution.
> > 
> > I'm doing quite strightforward matching using regular expressions in 
> > perl (as you can see below) and the code used to work just fine on the
> 
> > ActiveState perl, but behaves very strange with cygwin Perl:
> > 
> > -------------
> > unless ($page =~ /<a href="\#"
> onClick="window\.open\('(popBibTex.cfm\?.+?)',/s)
> > -------------
> > 
> > It simply does not match. I tried playing around, cuting certain
> suspicios 
> > parts, and here is what I found out:
> > 
> > -------------
> > unless ($page =~ /on\Click="window\.open\('(popBibTex.cfm\?.+?)',/s)
> > -------------
> > 
> > this does match. (notice the \ before C)
> > 
> > What's up? (::confused;)
> > 
> > I'm runing Win_XP_Pro/SP2, just installed Cygwin (and all 
> > tools/packages/modules that were available through the web install
> utility).
> 
> -- 
> 				http://cs.nyu.edu/~pechtcha/
>       |\      _,,,---,,_		pechtcha@cs.nyu.edu
> ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
>      |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
>     '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
> 
> "Happiness lies in being privileged to work hard for long hours in
> doing
> whatever you think is worth doing."  -- Dr. Jubal Harshaw
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]