Path: utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!cernvax!chx400!iam!metz From: metz@iam.unibe.ch (Igor Metz) Newsgroups: comp.lang.perl Subject: Patch level 12: explicit return bug/feature Message-ID: <1990Mar4.142721.27297@iam.unibe.ch> Date: 4 Mar 90 14:27:21 GMT Reply-To: metz@iam.unibe.ch (Igor Metz) Organization: University of Berne, Dept. of Computer Science Lines: 48 We upgraded from pl 8 to pl 12 and suddenly one of our favorite perl scripts didn't run anymore. I found out, that Patch Level 8 allowed the following syntax for the explicit return of an array: return (@files); In patch level 12 this syntax is still allowed, but this doesn't return the array, but its length... The program below gives the following output: 3 A B C ################################################ @val = &foo1(); print "@val \n"; @val = &foo2(); print "@val \n"; exit 0; sub foo1 { local(@files); @files = ("A", "B", "C"); return (@files); } sub foo2 { local(@files); @files = ("A", "B", "C"); return @files; } ################################################################ Igor Metz X400: metz@iamsm.iam.unibe.ch Institut fuer Informatik ARPA: metz%iamsm.iam.unibe.ch@relay.cs.net und angewandte Mathematik UUCP: ..!uunet!mcsun!iamsm.iam.unibe.ch!metz Universitaet Bern Phone: (0041) 31 65 49 90 Switzerland Fax: (0041) 31 65 39 65 -- Igor Metz X400: metz@iamsm.iam.unibe.ch Institut fuer Informatik ARPA: metz%iamsm.iam.unibe.ch@relay.cs.net und angewandte Mathematik UUCP: ..!uunet!mcsun!iamsm.iam.unibe.ch!metz Universitaet Bern Phone: (0041) 31 65 49 90