Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I see a few problems here. The first is that there is no <code>use strict;</code>.</p> <p>A number with a leading zero is assumed to be in octal format (i.e. base 8) so <code>08</code> is invalid. You want one of these:</p> <pre><code>%days = ("January", 1, "February", 2, ... %days = ("January", "01", "February", "02", ... %days = ("January" =&gt; 1, "February" =&gt; 2, ... %days = ("January" =&gt; "01", "February" =&gt; "02", ... </code></pre> <p>You should also be declaring your variables with <code>my</code>:</p> <pre><code>my %days = ... my @output = ... </code></pre> <p>You're missing the final slash on your substitution, you probably want a comma in there to match your desired output format, and <code>.*</code> will eat up more than you want:</p> <pre><code>$pattern =~ s/(\S*)\s/$days{$1}, /; </code></pre> <p>The block for your <code>map</code> needs to return the value you want in <code>@output</code> but it currently returns 1 (see <a href="http://perldoc.perl.org/perlop.html" rel="nofollow"><code>perldoc perlop</code></a> to learn why); something like this will serve you better:</p> <pre><code>my @output = map { my $pattern=$_; # You don't need this, operating on $_ is fine here $pattern =~ s/(\S*)\s/$days{$1}, /; $pattern } @dates; </code></pre> <p>If you really want the spaces removed from the output, then this should do the trick:</p> <pre><code>my @output = map { my $pattern=$_; # You don't need this, operating on $_ is fine here $pattern =~ s/(\S*)\s/$days{$1}, /; $pattern =~ s/\s//g; $pattern } @dates; </code></pre> <p>There are more compact ways to do this <code>map</code> but I don't want to change too much and confuse you.</p> <p>And, as mentioned in the comments, you might want to save yourself some trouble and have a look at <a href="http://search.cpan.org/dist/DateTime/" rel="nofollow"><code>DateTime</code></a> and related packages.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload