Re: where is $1 stored ?

[email protected] (John Doe)
Newsgroups perl.unicode
Message-ID <[email protected]>
rajarshi das am Freitag, 10. Juni 2005 07.10:
> Hi,
> I run this on z/OS and perl-5.8.6.
>
> $a = 'a';

	my $a='a';

> if ($a =~ /A/i)
> {
>   print "match";

will print "match"

>   print "$1";

	print $1;  # "" unneeded

will print nothing

> }
>
> Is the value in $1 stored in a struct SV ? Or how else
> is it stored ?

It is not stored in your code. It would have been stored if your regex looked 
like $a =~ /(A)/i (note the parens).

> Where exactly in the perl code is the value of $1 set?

perldoc perlrequick
perldoc perlretut
perldoc perlre



joe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.