sierrathedog04 has asked for the wisdom of the Perl Monks concerning the following question:
get_day_name is a function which returns a string. The map command below works properly if I store its output in a %myHash variable and then print the Dumper of a reference to %myHash.
However I should be able to print the output of map directly. Yet Perl doesn't compile
either. Nor does it compileprint Dumper \{map {$_ => get_day_name($_)} <DATA>};
Why?print Dumper {map {$_ => get_day_name($_)} <DATA>};
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Printing a reference to the output of map
by clintp (Curate) on Dec 01, 2001 at 03:28 UTC | |
Re: Printing a reference to the output of map
by Fastolfe (Vicar) on Dec 01, 2001 at 03:29 UTC | |
Re: Printing a reference to the output of map
by mikeB (Friar) on Dec 01, 2001 at 03:25 UTC | |
by clintp (Curate) on Dec 01, 2001 at 03:30 UTC | |
Re: Printing a reference to the output of map
by danboo (Beadle) on Dec 01, 2001 at 03:31 UTC | |
Re: Printing a reference to the output of map
by sierrathedog04 (Hermit) on Dec 01, 2001 at 17:46 UTC | |
by danboo (Beadle) on Dec 03, 2001 at 20:13 UTC |
Back to
Seekers of Perl Wisdom