Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

How is adding even more typing user-friendly, especially when there is only 1 variable? Also, since there is only 1 language I have abbreviations for, it seems a bit silly to make a user type in a second variable for it, when I would have to do something like the following in the subroutine to make it read.

my $language = $opt{'lang'}.' '.$opt{'abbr'};

Wouldn't it be less of a headache to just have an all in one without splitting the hash key name between two variables?

my $month = random_month('English abbr'); -or- my $month = random_month( 'lang' => 'English', 'abbr' => 1 );

I also expanded the selection of languages and how the languages can be selected.

use Date::Calc qw(Month_to_Text); # supports 14 languages my %months = ( 'English' => [map(Month_to_Text($_, 1),(1..12))], 'en' => [map(Month_to_Text($_, 1),(1..12))], 'French' => [map(Month_to_Text($_, 2),(1..12))], 'français' => [map(Month_to_Text($_, 2),(1..12))], 'fr' => [map(Month_to_Text($_, 2),(1..12))], 'German' => [map(Month_to_Text($_, 3),(1..12))], 'Deutsch' => [map(Month_to_Text($_, 3),(1..12))], 'de' => [map(Month_to_Text($_, 3),(1..12))], 'Spanish' => [map(Month_to_Text($_, 4),(1..12))], 'Espańol' => [map(Month_to_Text($_, 4),(1..12))], 'es' => [map(Month_to_Text($_, 4),(1..12))], 'Portuguese' => [map(Month_to_Text($_, 5),(1..12))], 'Portuguęs' => [map(Month_to_Text($_, 5),(1..12))], 'pt' => [map(Month_to_Text($_, 5),(1..12))], 'Dutch' => [map(Month_to_Text($_, 6),(1..12))], 'Nederlands' => [map(Month_to_Text($_, 6),(1..12))], 'nl' => [map(Month_to_Text($_, 6),(1..12))], 'Italian' => [map(Month_to_Text($_, 7),(1..12))], 'Italiano' => [map(Month_to_Text($_, 7),(1..12))], 'it' => [map(Month_to_Text($_, 7),(1..12))], 'Norwegian' => [map(Month_to_Text($_, 8),(1..12))], 'Norsk bokmĺl' => [map(Month_to_Text($_, 8),(1..12))], 'nb' => [map(Month_to_Text($_, 8),(1..12))], 'Swedish' => [map(Month_to_Text($_, 9),(1..12))], 'svenska' => [map(Month_to_Text($_, 9),(1..12))], 'sv' => [map(Month_to_Text($_, 9),(1..12))], 'Danish' => [map(Month_to_Text($_, 10),(1..12))], 'dansk' => [map(Month_to_Text($_, 10),(1..12))], 'da' => [map(Month_to_Text($_, 10),(1..12))], 'Finnish' => [map(Month_to_Text($_, 11),(1..12))], 'suomi' => [map(Month_to_Text($_, 11),(1..12))], 'fi' => [map(Month_to_Text($_, 11),(1..12))], 'Hungarian' => [map(Month_to_Text($_, 12),(1..12))], 'magyar' => [map(Month_to_Text($_, 12),(1..12))], 'hu' => [map(Month_to_Text($_, 12),(1..12))], 'Polish' => [map(Month_to_Text($_, 13),(1..12))], 'język polski' => [map(Month_to_Text($_, 13),(1..12))], 'pl' => [map(Month_to_Text($_, 13),(1..12))], 'Romanian' => [map(Month_to_Text($_, 14),(1..12))], 'Română' => [map(Month_to_Text($_, 14),(1..12))], 'ro' => [map(Month_to_Text($_, 14),(1..12))], 'Greek' => [qw(Ianuários Fevruários Mártios Aprílios Máios Iú +nios Iúlios Avghustos Septémvrios Októvrios Noémvrios Thekémvrios)], 'el' => [qw(Ianuários Fevruários Mártios Aprílios Máios Iú +nios Iúlios Avghustos Septémvrios Októvrios Noémvrios Thekémvrios)], );

About fatal warnings, I leave them in for me. I consider all warnings as bad as errors, because something is not right with the code if I'm being warned about it. If I were to ever make any module "official", I would it them out.

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena

In reply to Re^2: Is what you want available? by Lady_Aleena
in thread Is what you want available? by Lady_Aleena

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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, 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, 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (4)
    As of 2019-09-15 06:12 GMT
    Find Nodes?
      Voting Booth?
      The room is dark, and your next move is ...

      Results (178 votes). Check out past polls.