Skip to content

What is the problem? #1

@rurban

Description

@rurban

I don't see a motivating testcase, and the description is bogus.

perl -e'$_="x";%h=map{$_=>1}(0..3);print $_' => x # global $_ is restored

perl -e'sub x{$_="ouch"};$_="x";%h=map{$_=>x}(0..9);print $_' => x # global $_ is restored

Do you just need a map with a lexical iteration variable other than $_?
$_ is properly restored.

Something like map sub($i){$i => 1} @array for nested maps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions