I used perlfaq which suggested some of the code you guys have mentioned. Basically I get an output of the full list again...
Here's my code, the file read in is a csv...
my %defaultArgs = (
'porder' => 1,
'ptitle1' => 2,
'ptitle2' => 3,
'ptitle3' => 4,
'yorder' => 5,
'xorder' => 6,
'mtitle' => 7,
'size' => 8,
'avail' => 9,
'select' => 10,
'symbol' => 11,
'invert' => 14,
'isvary' => 15,
'unit' => 16,
'default' => 17,
'min' => 18,
'max' => 19,
'relative' => 20,
'monitor' => 21,
'ac' => 22,
'en' => 23,
'summary' => 24,
'device' => 25
);
my @arguments = ();
my @devices = ();
my @unique = ();
@devices = split( ',', $arguments[$defaultArgs{ device }] );
# foreach my $device (@devices)
# {
# print $device."\n";
# }
my %hash = map { $_ => 1 } @devices;
my @unique = keys %hash;
foreach my $uni (@unique)
{
print $uni."\n";
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.