From 3fe9a6f19eb206c685bd7389e54e2838fdfd04b7 Mon Sep 17 00:00:00 2001 From: Perl 5 Porters Date: Sat, 22 Mar 1997 15:34:25 +1200 Subject: [inseparable changes from match from perl-5.003_94 to perl-5.003_95] CORE LANGUAGE CHANGES Subject: Don't compile scalar mods of aggregates, like C<@a =~ s/a/b/> From: Chip Salzenberg Files: op.c t/op/misc.t Subject: Warn about undef magic values just like non-magic From: Chip Salzenberg Files: ext/Opcode/Safe.pm sv.c t/lib/db-btree.t t/lib/db-hash.t t/lib/db-recno.t t/pragma/locale.t CORE PORTABILITY Subject: Win32 update (five patches) From: Gurusamy Sarathy Files: MANIFEST README.win32 doio.c dosish.h pp_sys.c lib/ExtUtils/Command.pm t/comp/multiline.t t/op/magic.t t/op/mkdir.t t/op/runlevel.t t/op/stat.t t/op/write.t win32/Makefile win32/config.H win32/config.w32 win32/win32.c win32/win32.h win32/win32aux.c win32/*.mak win32/VC-2.0/*.mak DOCUMENTATION Subject: INSTALL-1.8 to INSTALL-1.9 updates Date: Tue, 25 Mar 1997 13:52:53 -0500 (EST) From: Andy Dougherty Files: INSTALL Msg-ID: Pine.SOL.3.95q.970325135138.3374A-100000@fractal.lafayette.e (applied based on p5p patch as commit 9b1ae96a0b4301a9588f62b3175bc0312302f4b9) Subject: Document possible problems with -Mdiagnostics after upgrade From: Chip Salzenberg Files: INSTALL Subject: Mention perldelta in INSTALL From: Chip Salzenberg Files: INSTALL Subject: Describe pod format at top of INSTALL From: Chip Salzenberg Files: INSTALL Subject: Document C fix From: Chip Salzenberg Files: pod/perldelta.pod Subject: pods for subroutine argument autovivication Date: Mon, 24 Mar 1997 07:25:21 +0000 From: "M.J.T. Guy" Files: pod/perldelta.pod pod/perlsub.pod Msg-ID: E0w9489-0005YT-00@ursa.cus.cam.ac.uk (applied based on p5p patch as commit db8878faa51a8a1541a40745a8613adb5db155e4) Subject: Missing item in perldiag Date: Sun, 23 Mar 1997 09:24:09 +0000 From: "M.J.T. Guy" Files: pod/perldiag.pod Msg-ID: E0w8jVZ-0005va-00@ursa.cus.cam.ac.uk (applied based on p5p patch as commit c00a529017138505fcbe538b74c7884abe1d18e1) Subject: Pod problems & fixes Date: Mon, 24 Mar 1997 21:31:51 +0100 (MET) From: Hallvard B Furuseth Files: INSTALL lib/Term/Complete.pm lib/subs.pm pod/perlcall.pod pod/perldata.pod pod/perldiag.pod pod/perlembed.pod pod/perlguts.pod pod/perlmod.pod pod/perlop.pod pod/perlpod.pod pod/pod2html.PL Msg-ID: 199703242031.VAA14997@bombur2.uio.no (applied based on p5p patch as commit 55a864fe4cea1a0586891b83d359ba71e0972da5) Subject: FAQ update From: Nathan Torkington Files: pod/perlfaq*.pod OTHER CORE CHANGES Subject: Improve 'prototype mismatch' warning From: Chip Salzenberg Files: global.sym op.c pod/perldiag.pod proto.h sv.c t/comp/redef.t --- pod/perlsub.pod | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'pod/perlsub.pod') diff --git a/pod/perlsub.pod b/pod/perlsub.pod index f2a5b8ff0f..6e2309dfb2 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -47,9 +47,17 @@ there's really no difference from the language's perspective.) Any arguments passed to the routine come in as the array @_. Thus if you called a function with two arguments, those would be stored in C<$_[0]> -and C<$_[1]>. The array @_ is a local array, but its values are implicit -references (predating L) to the actual scalar parameters. The -return value of the subroutine is the value of the last expression +and C<$_[1]>. The array @_ is a local array, but its elements are +aliases for the actual scalar parameters. In particular, if an element +C<$_[0]> is updated, the corresponding argument is updated (or an error +occurs if it is not updatable). If an argument is an array or hash +element which did not exist when the function was called, that element is +created only when (and if) it is modified or if a reference to it is +taken. (Some earlier versions of Perl created the element whether or not +it was assigned to.) Note that assigning to the whole array @_ removes +the aliasing, and does not update any arguments. + +The return value of the subroutine is the value of the last expression evaluated. Alternatively, a return statement may be used to specify the returned value and exit the subroutine. If you return one or more arrays and/or hashes, these will be flattened together into one large -- cgit v1.2.1