in reply to Make a hash by a range of keys and values
poj#!perl use warnings; use strict; print 'Last X Point > '; chomp(my $xpoints = <STDIN>); print 'Last Y Point > '; chomp(my $ypoints = <STDIN>); #print "X=$xpoints Y=$ypoints\n"; my %position = (); my $key = 'a'; for my $y (0..$ypoints){ for my $x (0..$xpoints){ $position{$key++} = [$x,$y]; } } use Data::Dump 'pp'; pp \%position;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Make a hash by a range of keys and values
by GHMON (Novice) on Nov 01, 2018 at 13:32 UTC |