in reply to Assignment changes handle?
This prints "4:z:z:z:outside:z" I think it is a bug in the interpreter. There is no $i[1] so it ends up assigning the last element of the list passed to map or the last literal value ("z") from the stack.#!/usr/bin/perl use strict; use diagnostics; my @i = (5); my $n; map { $n = @i[1..0]; print $n.":"; my $u = "z"; } (6,2,3,4); print "outside:"; print $n;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Assignment changes handle?
by Mugatu (Monk) on Mar 04, 2005 at 20:26 UTC |