develooper Front page | perl.perl5.porters | Postings from December 2000

[ID 19991109.004] Stringification doesn't seem to apply to regexp arguments

Thread Previous
From:
Stephen P. Potter
Date:
December 13, 2000 10:29
Subject:
[ID 19991109.004] Stringification doesn't seem to apply to regexp arguments
Message ID:
200012131831.NAA05688@spotter.yi.org
Another...

David Huggins-Daines writes:
> [dhd@willow]~ $ perl -le '$f=[1]; print $f; while ($f =~ /(\w+)/g) {print $1}'
> ARRAY(0x80cb97c)
> xl@x
> @80cb97c
> 
> It's evidently failing to stringify the scalar.

Evidently, not, as omiting //g shows.  Something is fishy with pos()
on a reference.  Is it wise to just plain prohibit it?

Ilya

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About