[comp.lang.perl] Minor compilation problem?

crehta@tasu74.UUCP (Ran Ever-Hadani) (12/26/89)

Perl 3.0 on Sun3 under OS 3.5 and on SPARCstation 1 under OS 4.0.3c:

In a perl script I mistakenly wrote '@_[2]' instead of '$_[2]' inside
an if condition.

Despite this error, the script seemed to work correctly, as long as
the processed input files were small.  When I attempted to run it
on a longer input (> 200 lines), it processed most of the file well, 
and then it reported a segmentation fault and dumped core.  needless
to say, the script worked well once I changed the '@_[2]' to '$_[2]'.

Shouldn't the @_[2] be detected as a syntax error by the compiler?

-- Ran
-----------------------------------------------------------------

The line in which it appeared was 
	if (@_[2] =~ /ALL|>/) { 
and dbx on the core gave

tasu77 % dbx perl
Reading symbolic information...
Read 1483 symbols
(dbx) where
do_match(0x77ce4, 0x77da4, 0x0, 0xefff4cc) at 0xefbc
eval(0x77da4, 0x0, 0xffffffff) at 0x1237f
cmd_exec(0x71d84, 0x0, 0xffffffff) at 0x3a37
cmd_exec(0x719c4, 0x0, 0xffffffff) at 0x2d8f
cmd_exec(0x71f84, 0x0, 0xffffffff) at 0x2d8f
main(0x2, 0xefff670, 0xefff67c) at 0x1a1ef
(dbx) q
-----------------------------------------------
Reply-To: crehta@taux01.nsc.com (Ran Ever-Hadani)
Disclaimer: The above is to be attributed to me only, not to any organization.
Apology: Bad English.  E-mailed spelling and style corrections are welcome.