here is a great way to keep it neat and listed in numerical order as well
#!/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",
);
### PRINT THE SORTED HASH ###
say "$_ - $j{$_}" for sort { $a <=> $b } keys(%j);
### GET USER SELECTION ###
my $number = <STDIN>;
chomp($number);
### PRINT OUT $j{$number} DIRECTLY INSTEAD OF COPYING IT TO ANOTHER BU
+FFER ###
say "\r\b\ryou picked -> $j{$number}\n" if exists $j{$number} or die "
+selection <$number> does not exist in the list!\n";
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.