[vienna.pm] Probleme mit einem script

Peter J . Holzer hjp at wsr.ac.at
Tue Jul 11 09:50:49 CDT 2000


On 2000-06-27 09:31:58 +0200, Marcel Grunauer wrote:
> 
> 	my $i;
> 	for $i (1..4) { ... }
> 	print $i;
> 
> 	# prints the undef value

Spannend. $i hat nach der Schleife den gleichen Wert wie vorher.
Offensichtlich ist
    for $i (...)
völlig äquivalent zu
    for my $i (...)

(auch perl -w schreit in dem Fall nicht, wenn $i vorher nicht definiert
war).

	hp

-- 
   _  | Peter J. Holzer      | 1980: If it's worth implementing once,
|_|_) | Sysadmin WSR / LUGA  |       it's worth implementing twice.
| |   | hjp at wsr.ac.at        | 1990: Ship the prototype!
__/   | http://www.hjp.at/   | 2000: Ship the idea!      -- Larry Rosler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 371 bytes
Desc: not available
Url : http://mail.pm.org/archives/vienna-pm/attachments/20000711/a68ed65d/attachment.bin


More information about the Vienna-pm mailing list