#!/usr/bin/perl use strict; my %foo; my $key; $foo{&KEY_NAME}="jon"; $foo{&KEY_OCCUPATION}="just another perl hacker"; sub KEY_NAME { return "Name"; } sub KEY_OCCUPATION { return "Occupation"; } foreach $key(keys %foo) { print "$key : " . $foo{$key} . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Constants and perl
by chromatic (Archbishop) on Jun 15, 2000 at 02:56 UTC | |
|
RE: Constants and perl
by btrott (Parson) on Jun 15, 2000 at 03:03 UTC |