Loading ...
Sorry, an error occurred while loading the content.

[PBML] Re: Need some serious help. Day of the month from a date

Expand Messages
  • jonathan.mark2@dyncorp.com
    Thanks. I found the error. It was in the line above the call to map. Instead of using Perl s // to create a comment I was using /* */ to create a comment,
    Message 1 of 4 , Dec 1, 2001
    View Source
    • 0 Attachment
      Thanks. I found the error. It was in the line above the call to map.
      Instead of using Perl's // to create a comment I was using /* */ to
      create a comment, which is gibberish to perl.


      --- In perl-beginner@y..., "Charles K. Clarkson" <cclarkson@h...>
      wrote:
      > <jonathan.mark2@d...>
      >
      > : Thanks for the quick response. Perl doesn't compile
      > :
      > : print Dumper {map {$_ => get_day_name($_)} <DATA>};
      > :
      > : either. Nor does it compile
      > :
      > : print Dumper \{map {$_ => get_day_name($_)} <DATA>};
      > :
      > : Why? Any ideas? Your script runs fine as long as I don't mess
      with
      > : it. But messing with scripts is the whole idea behind Perl.
      >
      > This runs fine on my system. What do you mean by 'it does not
      > compile'? What specific error messages are you getting?
      >
      > #!/usr/bin/perl
      > use strict;
      > use warnings;
      > #use diagnostics;
      >
      > use Data::Dumper;
      > use POSIX;
      >
      > print Dumper { map {$_ => get_day_name()} <DATA> };
      >
      > sub get_day_name {
      > chomp;
      > my @date = m|^(\d+)/(\d+)/(\d+)|;
      > $date[1] -= 1;
      > $date[2] -= 1900;
      > return strftime "%A", 0, 0, 0, @date;
      > }
      >
      > __END__
      > 26/11/2001_Page_1.pp
      > 27/11/2001_Page_1.pp
      > 28/11/2001_Page_1.pp
      > 29/11/2001_Page_1.pp
      >
      >
      > HTH,
      > Charles K. Clarkson
      > Clarkson Energy Homes, Inc.
      >
      > Language is the dress of thought.
      > - Samuel Johnson
    Your message has been successfully submitted and would be delivered to recipients shortly.