ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Re: s/ / /; - doing harm ?
by Stanislaw Romanski other posts by this author
Jun 9 2009 12:51AM messages near this date
Re: s/ / /; - doing harm ? | Perl / CGI and IIS6
----- Original Message ----- 
From: "Bill Luebkert" <dbecoll@[...].com> 
To: "Stanislaw Romanski" <s.romanski@[...].pl> 
Cc: <activeperl@[...].com> 
Sent: Tuesday, June 09, 2009 9:41 AM
Subject: Re: s/ / /; - doing harm ?


>  Stanislaw Romanski wrote:
> > Hello,
> >  
> > Please, consider the following short script.
> > #-----------------------------------------------------
> > $_ = '';
> >  
> >     s// /;      ## if any of these two lines is commented out,
> >     s/ / /;     ## the printed result wil be ok, i.e. '= =' WHY ?
> >  
> > $_ = '';
> > s// /;
> > print "=$_=\n";         ## prints incorrect '=='
> > #-----------------------------------------------------
> >  
> > This was tested on Win'XT ActivePerl 5.8.8. and 5.8.9.
> >  
> > What is wrong ?
>  
>  If you check the perlop pod under s///, you should find this:
>    "If the pattern evaluates to the empty string, the last
>    successfully executed regular expression is used instead."
> 

Hello Bill,

Thanks for (en)lightning answer.
You saved a few hours of my frustration ;-)

Stanislaw Romanski
_______________________________________________
ActivePerl mailing list
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Stanislaw Romanski
Bill Luebkert
Stanislaw Romanski

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved