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." _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
