WisDomSeeKer34 has asked for the wisdom of the Perl Monks concerning the following question:
I get the error message:" Use of uninitialized value $x in say". It doens't make sense to me.#!/usr/bin/env perl use strict; use warnings; use utf8; use feature 'say'; use File::Copy; my %j = ( 1 => 'vimplugins', 2 => "vimwiki", 3 => "vim", 4 => "bash", 5 => "latex", 6 => "perl", 7 => "regex", 8 => "git", 9 => "gnupg", 10 => "nmap", 11 => "tmux", 12 => "csssnippets", 13 => "htmlsnippets", 14 => "latexsnippets", 15 => "markdownsnippets", 16 => "perlsnippets", 17 => "vimsnippets", ); my $number = <STDIN>; say $number; my $x = $j{$number}; say $x; say "done";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Easy hash question (uninitialized value)
by 1nickt (Canon) on May 16, 2018 at 11:53 UTC | |
|
Re: Easy hash question (uninitialized value)
by marto (Cardinal) on May 16, 2018 at 10:55 UTC | |
|
Re: Easy hash question (uninitialized value)
by Lotus1 (Vicar) on May 16, 2018 at 13:54 UTC | |
|
Re: Easy hash question (uninitialized value)
by Anonymous Monk on May 16, 2018 at 10:51 UTC | |
by WisDomSeeKer34 (Sexton) on May 16, 2018 at 11:05 UTC | |
|
Re: Easy hash question (uninitialized value)
by marto (Cardinal) on May 16, 2018 at 10:55 UTC | |
|
Re: Easy hash question (uninitialized value)
by james28909 (Deacon) on May 16, 2018 at 19:02 UTC |