[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] $_=$l[rand@l]; (fwd)



Earlier I wrote:
> 
> Kevin Reid wrote:
> > Something to try shortening:
> > 
> > @ARGV='iMax:Documents:Info:lwall-quotes.txt';$/='%%
> > ';@l=<>;$_=$l[rand@l];chomp;print
> 
> Two characters:
> 
> @ARGV='iMax:Documents:Info:lwall-quotes.txt';$/='%%
> ';@l=<>;print$l[rand@l]=~/(.*)/

To which Ronald J Kimball responded by saying that the
semantics of /(.*)/ is different because $/ has been
changed.

I was not able to confirm that assertion; my tests
showed /(.*)/ still considers . (dot) to exclude \n
specifically, not $/.  Can anyone shed some light on
this?  Is it a perl version difference?

John Porter


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe