Re: How do I find the key of a specific hash element?
[email protected] ("Dr.Ruud")
| Newsgroups | perl.beginners |
|---|---|
| Organization | Chaos rules. |
| Message-ID | <[email protected]> |
Rob Dixon schreef:
> Dr.Ruud:
>> perl -le'
>> #!/usr/bin/perl
>> use strict;
>> use warnings;
>>
>> my @n2d = qw( SUN MON TUE WED THU FRI SAT );
>> my %d2n; @d2n{ @n2d } = ( 0 .. $#n2d );
>>
>> print $d2n{ WED };
>> '
>> 3
>
> It doesn't help to write UNIX shell commands when we are talking
> about a cross-platform language. Please stop.
Well, I just like to show variety, and I like directly runnable code.
That Windows users need dquotes to run the above in a similar way, is
something a Windows user can easily know or learn.
--
Affijn, Ruud
"Gewoon is een tijger."