You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Christoph Bergmann <in...@java.seite.net> on 2001/10/10 20:17:19 UTC

predefined arrays @- and @+ with mod_perl?

Hi...

I wonder if there exists the predefined arrays @- and @+ in mod_perl.
The following lines:

print "$_ " foreach (@-);
print "<br>";
print "$_ " foreach (@+);

print out:

10 10 11
11 11 11

This works _only_ when called via browser under mod_perl. Started from
the shell it prints out nothing (except "<br>") - as expected.

I use apache 1.3.20, perl 5.6.1 and mod_perl 1.26.

I've never read about such predefined Arrays - what do they contain and
why are they global?

Thanks in advance!

Best regards,

Christoph Bergmann

Re: predefined arrays @- and @+ with mod_perl?

Posted by Christoph Bergmann <in...@java.seite.net>.
Ilya Martynov wrote:
> 
> >>>>> On Wed, 10 Oct 2001 20:17:19 +0200, Christoph Bergmann <in...@java.seite.net> said:
> 
> CB> Hi...
> CB> I wonder if there exists the predefined arrays @- and @+ in mod_perl.
> 
> See 'perldoc perlvar'. AFAIK These arrays should be defined after any
> successful regexp match (in new Perls - probably >= 5.6.1)
> 

ah, ok, thanks, I've just ugraded to 5.6.1...

best regards,

christoph bergmann

Re: predefined arrays @- and @+ with mod_perl?

Posted by Ilya Martynov <il...@martynov.org>.
>>>>> On Wed, 10 Oct 2001 20:17:19 +0200, Christoph Bergmann <in...@java.seite.net> said:

CB> Hi...
CB> I wonder if there exists the predefined arrays @- and @+ in mod_perl.
CB> The following lines:

CB> [..skip..]

See 'perldoc perlvar'. AFAIK These arrays should be defined after any
successful regexp match (in new Perls - probably >= 5.6.1)

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Re: predefined arrays @- and @+ with mod_perl?

Posted by Jim Smith <jg...@moya.tamu.edu>.
On Wed, Oct 10, 2001 at 08:17:19PM +0200, Christoph Bergmann wrote:
> Hi...
> 
> I wonder if there exists the predefined arrays @- and @+ in mod_perl.
> The following lines:
> 
> print "$_ " foreach (@-);
> print "<br>";
> print "$_ " foreach (@+);
> 
> print out:
> 
> 10 10 11
> 11 11 11
> 
> This works _only_ when called via browser under mod_perl. Started from
> the shell it prints out nothing (except "<br>") - as expected.
> 
> I use apache 1.3.20, perl 5.6.1 and mod_perl 1.26.
> 
> I've never read about such predefined Arrays - what do they contain and
> why are they global?

Do see the perl documentation for details.  They are related to regexes and
there could be a regex hidden somewhere in mod_perl before your code is
executed.  That would explain the different behaviors.

--jim

Re: predefined arrays @- and @+ with mod_perl?

Posted by Jim Smith <jg...@moya.tamu.edu>.
On Wed, Oct 10, 2001 at 01:05:18PM -0700, Medi Montaseri wrote:
> 
> The identifier production in Perl is
> [a-zA-Z_]\w+
> 
> So '-' and '+' are not valid symbols...

pp. 667-668, 3rd. Ed. Camel book

--jim

Re: predefined arrays @- and @+ with mod_perl?

Posted by Medi Montaseri <me...@CyberShell.com>.
The identifier production in Perl is
[a-zA-Z_]\w+

So '-' and '+' are not valid symbols...

On Wed, 10 Oct 2001, Christoph Bergmann wrote:

> Hi...
> 
> I wonder if there exists the predefined arrays @- and @+ in mod_perl.
> The following lines:
> 
> print "$_ " foreach (@-);
> print "<br>";
> print "$_ " foreach (@+);
> 
> print out:
> 
> 10 10 11
> 11 11 11
> 
> This works _only_ when called via browser under mod_perl. Started from
> the shell it prints out nothing (except "<br>") - as expected.
> 
> I use apache 1.3.20, perl 5.6.1 and mod_perl 1.26.
> 
> I've never read about such predefined Arrays - what do they contain and
> why are they global?
> 
> Thanks in advance!
> 
> Best regards,
> 
> Christoph Bergmann
> 

-- 
-------------------------------------------------------------------------
Medi Montaseri                               medi@CyberShell.com
Unix Distributed Systems Engineer            HTTP://www.CyberShell.com
CyberShell Engineering
-------------------------------------------------------------------------