This queue is for tickets about the IO-Prompt CPAN distribution.

Report information
The Basics
Id:
61381
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
edward.doolittle [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



From edward.doolittle@gmail.com Thu Sep 16 00: 46:09 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.912 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
X-Spam-Flag: NO
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Type: multipart/alternative; boundary=0015174c35441cd3880490592a84
Message-ID: <AANLkTinMUF2m7ghuoO-vexT+s3u0_CuhJULn7C6tt6u7@mail.gmail.com>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -9.912
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id A05C561E006 for <cpan-bug+io-prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 00:46:09 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cleIKCCmpMjh for <cpan-bug+io-prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 00:46:07 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id E8F4D240C96 for <bug-io-prompt@rt.cpan.org>; Thu, 16 Sep 2010 00:46:06 -0400 (EDT)
Received: (qmail 430 invoked by uid 103); 16 Sep 2010 04:49:05 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Sep 2010 04:49:05 -0000
Received: from mail-ew0-f50.google.com (HELO mail-ew0-f50.google.com) (209.85.215.50) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 15 Sep 2010 21:49:03 -0700
Received: by ewy24 with SMTP id 24so405151ewy.9 for <bug-io-prompt@rt.cpan.org>; Wed, 15 Sep 2010 21:48:59 -0700 (PDT)
Received: by 10.213.17.195 with SMTP id t3mr2051275eba.61.1284612539863; Wed, 15 Sep 2010 21:48:59 -0700 (PDT)
Received: by 10.213.33.80 with HTTP; Wed, 15 Sep 2010 21:48:59 -0700 (PDT)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i=@gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=edward.doolittle@gmail.com
Delivered-To: cpan-bug+io-prompt@hipster.bestpractical.com
Subject: Weird behavior with IO::Prompt and numbers
Return-Path: <edward.doolittle@gmail.com>
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=QcP6WMnQRtEwbEx6F+hamZfUzwQURBROcG3sQuT+Me4KWZLpAlbIP9ltTCOzVyOZ6y Lmq7m1pg6k1QNU+h+VFvYBHN17+LBsxxSh9G5Vn3dyl0t64eDIRQ4XAb7PudSqiECgBU N082raQzaOOOYirVH6p3nj+g8O6LAdsdGmpIw=
X-RT-Mail-Extension: io-prompt
X-Original-To: cpan-bug+io-prompt@hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=jKqgNsqb73AiZuA2AqgoXCbLj2h4CmhUEQPSAj1d0SE=; b=rge5bcNXliAZ7fd3lod7vXCkv0s+2rGaHDoLfykp0fWJaoGTG/zdYBGcu3VkhNvNft uRUC02wKuaCCAM/psMeor7CX50af2KN9+gnJ02NAY2qldnuZT5CvTPJNsqMKxP9a+KKP uDmQlv1n3rQ25jAxqol8fOfT1CChjGMC4rlTk=
Date: Wed, 15 Sep 2010 22:48:59 -0600
X-Spam-Level:
To: bug-io-prompt@rt.cpan.org
From: Edward Doolittle <edward.doolittle@gmail.com>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 3246
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 10905
Hi,

I'm using IO::Prompt to gather some information about dates at the terminal.  Below is a transcript of the output, followed by the program.  As you can see the calculated weekday for 2010-9-15 bounces all over the place, as if there were some weird invisible garbage in the $day, $month, and/or $year variables.  However, if I uncomment the commented line in my program which just injects numbers into those variables rather than reads them from the command line, the output is normal, consistent, and correct as expected.  I concluded that the problem is with IO::Prompt and not with Date::Calc.  I'm running

This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi
(with 46 registered patches, see perl -V for more detail)

on Debian Linux and version 0.997001 of IO::Prompt.  Can you tell me what I'm doing wrong, or what is wrong with IO::Prompt?

Edward


Month number: 9
Day number: 15
Year number: 2010
year is 2010, month is 9, day is 15, wday is 6
September 15, 2010 was a Saturday

Month number: 9
Day number: 15
Year number: 2010
year is 2010, month is 9, day is 15, wday is 3
September 15, 2010 was a Wednesday

Month number: 9
Day number: 15
Year number: 2010
year is 2010, month is 9, day is 15, wday is 6
September 15, 2010 was a Saturday

Month number: 9
Day number: 15
Year number: 2010
year is 2010, month is 9, day is 15, wday is 2
September 15, 2010 was a Tuesday

Month number: ^D dolittle@yoyodyne:~/Courses/math101$


#!/usr/bin/perl

use strict;
use warnings;
use Readonly;

use Date::Calc qw( Day_of_Week );
use IO::Prompt;

my @days = qw( Error    Monday    Tuesday  Wednesday
               Thursday Friday    Saturday Sunday
             );

my @mons = qw( Error    January   February March
               April    May       June     July
               August   September October  November
               December
             );

Readonly my $MONTH_PROMPT   => q{Month number: };
Readonly my $DAY_PROMPT     => q{Day number:   };
Readonly my $YEAR_PROMPT    => q{Year number:  };

Readonly my $MONTH_REGEX    => qr/ [1-9] | 1[0-2] /x;
Readonly my $DAY_REGEX      => qr/ [1-9] | [1-2][0-9] | 3[0-1] /x;
Readonly my $YEAR_REGEX     => qr/ [1-9][0-9]* /x;

Readonly my $MONTH_REPROMPT => q{(must be in range 1..12) Month number: };
Readonly my $DAY_REPROMPT   => q{(must be in range 1..31) Day number:   };
Readonly my $YEAR_REPROMPT  => q{(must be positve integer) Year number: };

DATE:
while (1) {
    my $month
        = prompt( $MONTH_PROMPT, -req => { $MONTH_REPROMPT => $MONTH_REGEX });
    last DATE if !$month;

    my $day
        = prompt( $DAY_PROMPT,   -req => { $DAY_REPROMPT   => $DAY_REGEX }  );
    last DATE if !$day;

    my $year
        = prompt( $YEAR_PROMPT,  -req => { $YEAR_REPROMPT  => $YEAR_REGEX } );
    last DATE if !$year;

    last DATE if ($month==6 && $day==6 && $year==66);

    #($year,$month,$day) = (2010,9,15);
    my $wday = Day_of_Week($year,$month,$day);

    print "year is $year, month is $month, day is $day, wday is $wday\n";
    print "$mons[$month] $day, $year was a $days[$wday]\n\n";
}

--
Edward Doolittle
Associate Professor of Mathematics
Department of Science
First Nations University of Canada
1 First Nations Way, Regina SK S4S 7K2
+1 (306) 537-9631
From thoughtstream@gmail.com Thu Sep 16 04: 15:13 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-8.845 tagged_above=-99.9 required=10 tests=[AWL=1.068, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-24873-1284612549-1221.61381-4-0@rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-61381@rt.cpan.org> <AANLkTinMUF2m7ghuoO-vexT+s3u0_CuhJULn7C6tt6u7@mail.gmail.com> <rt-3.8.HEAD-24873-1284612549-1221.61381-4-0@rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <AANLkTin_fSZmiDRXW+zuVfKaUHk5+=9HkT=ziibraiqL@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -8.845
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i=@gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.sender=thoughtstream@gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 78FC661E008 for <cpan-bug+IO-Prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 04:15:13 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qZdQOIshAm9J for <cpan-bug+IO-Prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 04:15:11 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 25B1861E006 for <bug-IO-Prompt@rt.cpan.org>; Thu, 16 Sep 2010 04:15:10 -0400 (EDT)
Received: (qmail 29762 invoked by uid 103); 16 Sep 2010 08:18:09 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Sep 2010 08:18:09 -0000
Received: from mail-qy0-f171.google.com (HELO mail-qy0-f171.google.com) (209.85.216.171) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 16 Sep 2010 01:18:07 -0700
Received: by qyk30 with SMTP id 30so4635597qyk.9 for <bug-IO-Prompt@rt.cpan.org>; Thu, 16 Sep 2010 01:18:04 -0700 (PDT)
Received: by 10.229.182.141 with SMTP id cc13mr2104641qcb.56.1284625084304; Thu, 16 Sep 2010 01:18:04 -0700 (PDT)
Received: by 10.229.31.76 with HTTP; Thu, 16 Sep 2010 01:17:24 -0700 (PDT)
Delivered-To: cpan-bug+IO-Prompt@hipster.bestpractical.com
Subject: Re: [rt.cpan.org #61381] Weird behavior with IO::Prompt and numbers
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=UfXxHwRxAFnr6htKfENnsdzH9OXz4WvoYF7H2RCTCh1xO89KMvKvwQMt/cy0roLlaG c3v5F5OBXYfpjUSxklpjJYS83FpedARyFcI2VjcwLaT8q8KPznK3q2zALQJ85drw2/Xy z8acWKASir81e/neYLJ71PbuptNPe1DYXMx+g=
Return-Path: <thoughtstream@gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=QJbTkYeRdY/1BUEjXygRYXnCFfQupXw+zWbFuz1lbeQ=; b=JC4pO/fe6d1e4M88GaImJ23sFSATSmojyaTA8D+qnLVvlMiwUO9R7g62ADkQbEOMZN Ux3FSMduQRf1Erqq4CW3sMH2w+GjngXvY9ZgXb7BkZ/xiAKKgQWg7ZKO2O845ZVxO7L1 5hiigZZ+UZyE/o+flLYz+nfd9Hvu3J9ra85IE=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+IO-Prompt@hipster.bestpractical.com
X-RT-Mail-Extension: io-prompt
X-Google-Sender-Auth: VnJt70POsGjJIfAgIkft9fTANCw
Sender: thoughtstream@gmail.com
Date: Thu, 16 Sep 2010 16:17:24 +0800
X-Spam-Level:
To: bug-IO-Prompt@rt.cpan.org
From: Damian Conway <damian@conway.org>
RT-Message-ID: <rt-3.8.HEAD-24874-1284625093-186.61381-0-0@rt.cpan.org>
Content-Length: 906
Hi Edward, I can't replicate the (weird) behaviour you're seeing when I run your sample code on my own system under Perl 5.10.0. That makes it tough to diagnose the problem. About the only possibility that come to mind is that IO::Prompt returns an object (with a stringification overloading), not a simple string. It is *possible* that Date::Calc::Day_of_Week() doesn't like to be fed objects. In which case, you could try changing the line: my $wday = Day_of_Week($year,$month,$day); to: my $wday = Day_of_Week("$year","$month","$day"); to ensure that you're feeding it actual strings (instead of stringifiable objects). Let me know if that helps. If it does solve the problem, then (arguably) the bug is in Date::Calc...but all that really matters is that we solved your problem. :-) Meanwhile, I'll keep thinking about what else might be causing your difficulties. All the best, Damian
From edward.doolittle@gmail.com Thu Sep 16 05: 12:45 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.912 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-24874-1284625093-1848.61381-6-0@rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-61381@rt.cpan.org> <AANLkTinMUF2m7ghuoO-vexT+s3u0_CuhJULn7C6tt6u7@mail.gmail.com> <rt-3.8.HEAD-24873-1284612549-1221.61381-4-0@rt.cpan.org> <AANLkTin_fSZmiDRXW+zuVfKaUHk5+=9HkT=ziibraiqL@mail.gmail.com> <rt-3.8.HEAD-24874-1284625093-1848.61381-6-0@rt.cpan.org>
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <AANLkTinp-ezLp3+UbVgevT_bxMbkfdjxvOOb1TcMNWuN@mail.gmail.com>
Content-Type: multipart/alternative; boundary=0015174c3e866ddd4404905ce30e
X-Spam-Score: -9.912
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i=@gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=edward.doolittle@gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id C877F61E007 for <cpan-bug+IO-Prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 05:12:44 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HYArcHscDvgK for <cpan-bug+IO-Prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 05:12:42 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id B55E461E006 for <bug-IO-Prompt@rt.cpan.org>; Thu, 16 Sep 2010 05:12:40 -0400 (EDT)
Received: (qmail 3769 invoked by uid 103); 16 Sep 2010 09:15:39 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Sep 2010 09:15:39 -0000
Received: from mail-ew0-f50.google.com (HELO mail-ew0-f50.google.com) (209.85.215.50) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 16 Sep 2010 02:15:37 -0700
Received: by ewy24 with SMTP id 24so441266ewy.9 for <bug-IO-Prompt@rt.cpan.org>; Thu, 16 Sep 2010 02:15:33 -0700 (PDT)
Received: by 10.213.22.207 with SMTP id o15mr3493116ebb.97.1284628533861; Thu, 16 Sep 2010 02:15:33 -0700 (PDT)
Received: by 10.213.33.80 with HTTP; Thu, 16 Sep 2010 02:15:33 -0700 (PDT)
Delivered-To: cpan-bug+IO-Prompt@hipster.bestpractical.com
Subject: Re: [rt.cpan.org #61381] Weird behavior with IO::Prompt and numbers
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=d1wmo4376qb4q8C0w9TVWNYGcVtke4uEq/Jzu5BRDL+l98ZWELDBbxYM+lJKXaYGWU x/QiLch8SRCapmytoRHQn73ahkbY59jdLoHtmC0eUURxpewIeS6BsEAr+NIc3S7DFy2t manAQ4GO76gtbUuecslidTf2dIWNdwEqdDqkE=
Return-Path: <edward.doolittle@gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=fAfkhkSCF8Ky/OovkJsX8Hpc0+vqQEeQOahwHKOSHVQ=; b=pKrhJCvvYba0DroAN3vR0A7pklwi1H/mjPVmvEoW3vV6cAdXTesuZyXY8i0jJopzkK 47Wfy6u2i0GDgLeIf9UwNSIHX7GrnCyyvk7ECsgRXSngQS5UXl7ZIiHQhQb9hvRrpWC2 bcygCUw0eNmOhaewSuAg2Oegu0rmoIvly53DY=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+IO-Prompt@hipster.bestpractical.com
X-RT-Mail-Extension: io-prompt
Date: Thu, 16 Sep 2010 03:15:33 -0600
X-Spam-Level:
To: bug-IO-Prompt@rt.cpan.org
From: Edward Doolittle <edward.doolittle@gmail.com>
RT-Message-ID: <rt-3.8.HEAD-24882-1284628545-1112.61381-0-0@rt.cpan.org>
Content-Length: 0
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 1586
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 2253
Hi Damian,

Stringifying the stringifiable objects as per your suggestion works for me.  Thanks! 

The non-deterministic nature of the bug was rather surprising ... I guess it might have something to do with the index of the memory location of the object.

Should I report a bug to Date::Calc?

Edward



On Thu, Sep 16, 2010 at 2:18 AM, damian@conway.org via RT <bug-IO-Prompt@rt.cpan.org> wrote:
Show quoted text
<URL: https://rt.cpan.org/Ticket/Display.html?id=61381 >

Hi Edward,

I can't replicate the (weird) behaviour you're seeing when I run your
sample code on my own system under Perl 5.10.0.

That makes it tough to diagnose the problem. About the only possibility
that come to mind is that IO::Prompt returns an object (with a
stringification overloading), not a simple string. It is *possible* that
Date::Calc::Day_of_Week() doesn't like to be fed objects. In which case,
you could try changing the line:

  my $wday = Day_of_Week($year,$month,$day);

to:

  my $wday = Day_of_Week("$year","$month","$day");

to ensure that you're feeding it actual strings (instead of
stringifiable objects).

Let me know if that helps. If it does solve the problem, then (arguably)
the bug is in Date::Calc...but all that really matters is that we solved
your problem. :-)

Meanwhile, I'll keep thinking about what else might be causing your
difficulties.

All the best,

Damian




--
Edward Doolittle
Associate Professor of Mathematics
Department of Science
First Nations University of Canada
1 First Nations Way, Regina SK S4S 7K2
(306) 537-9631
From thoughtstream@gmail.com Thu Sep 16 16: 33:00 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-8.878 tagged_above=-99.9 required=10 tests=[AWL=1.035, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-24882-1284628546-5.61381-5-0@rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-61381@rt.cpan.org> <AANLkTinMUF2m7ghuoO-vexT+s3u0_CuhJULn7C6tt6u7@mail.gmail.com> <rt-3.8.HEAD-24873-1284612549-1221.61381-4-0@rt.cpan.org> <AANLkTin_fSZmiDRXW+zuVfKaUHk5+=9HkT=ziibraiqL@mail.gmail.com> <rt-3.8.HEAD-24874-1284625093-1848.61381-6-0@rt.cpan.org> <AANLkTinp-ezLp3+UbVgevT_bxMbkfdjxvOOb1TcMNWuN@mail.gmail.com> <rt-3.8.HEAD-24882-1284628546-5.61381-5-0@rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <AANLkTikJNEeat4YjL8HHFqpWvCtThM5c-bCCbZ4gFzxX@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -8.878
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i=@gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.sender=thoughtstream@gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 3F96761E009 for <cpan-bug+IO-Prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 16:33:00 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2dKpD7yoNX8p for <cpan-bug+IO-Prompt@hipster.bestpractical.com>; Thu, 16 Sep 2010 16:32:58 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 47F3F240D06 for <bug-IO-Prompt@rt.cpan.org>; Thu, 16 Sep 2010 16:32:58 -0400 (EDT)
Received: (qmail 1227 invoked by uid 103); 16 Sep 2010 20:35:57 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Sep 2010 20:35:57 -0000
Received: from mail-qw0-f50.google.com (HELO mail-qw0-f50.google.com) (209.85.216.50) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 16 Sep 2010 13:35:55 -0700
Received: by qwb7 with SMTP id 7so1141525qwb.9 for <bug-IO-Prompt@rt.cpan.org>; Thu, 16 Sep 2010 13:35:52 -0700 (PDT)
Received: by 10.229.70.204 with SMTP id e12mr2755950qcj.113.1284669352283; Thu, 16 Sep 2010 13:35:52 -0700 (PDT)
Received: by 10.229.31.76 with HTTP; Thu, 16 Sep 2010 13:35:12 -0700 (PDT)
Delivered-To: cpan-bug+IO-Prompt@hipster.bestpractical.com
Subject: Re: [rt.cpan.org #61381] Weird behavior with IO::Prompt and numbers
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=HCMfsMzBg5u9UfZQBlxvGllWSsyOoo9TiGMzOPgMF+7o+4xF1DyLJ0u4kckztycoY4 quev+JiHItCztqUu6hXRrPIhl/NsRZ01+OiVao3XelTq50pOV3odN8/c3XYtPjp3IMwF 0+2OnFNwM+6PTMcJ9sZo38x2BWP74hXNJ6liI=
Return-Path: <thoughtstream@gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=uMa0K0f9zHc81lmiAEeEjT5DApkngQ6AvsExw5AXPng=; b=GRhG4ti0JQht4/X2VGfxcHSN1VFpigzG5qnJiso3xWJEEOlneDHCvxmavAnZR5ZJxc tqj/7bLUOvbXvypCbbS6A/RfQy+Q9dGGujTxY8cXJR28a55NstaTVBDxmlDQb9Tgxb15 cjLoy1zTbYjRfXy92rnMWJs/3GC/UrnlcwLy8=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+IO-Prompt@hipster.bestpractical.com
X-RT-Mail-Extension: io-prompt
X-Google-Sender-Auth: Yn5sq4fIkzLmHL7JyUujJoLnSfA
Sender: thoughtstream@gmail.com
Date: Fri, 17 Sep 2010 04:35:12 +0800
X-Spam-Level:
To: bug-IO-Prompt@rt.cpan.org
From: Damian Conway <damian@conway.org>
RT-Message-ID: <rt-3.8.HEAD-24885-1284669360-1336.61381-0-0@rt.cpan.org>
Content-Length: 1344
Hi Edward, Glad to hear that...
Show quoted text
> Stringifying the stringifiable objects as per your suggestion works for me.
I suspect that you're right: the inconsistent results might have been caused by Date::Calc using the object addresses, rather than the object numerification. This may be due to the fact that the module is implemented in C, not Perl (i.e. the C functions may be assuming they are passed day/month/year numbers, but not actually checking that, and hence just using the object references directly as if they were numbers, instead of invoking the correct numerical overloading.) If that is indeed the case, then it might be considered a bug in Date::Calc, or at least an omission from its documentation. On the other hand, since it worked fine on my Mac under 5.10.0, it might also be a bug in Perl 5.10.1, or in the C compiler on Debian.
Show quoted text
> Should I report a bug to Date::Calc?
I think you should report the *situation* to Date::Calc and let the maintainer decide if it's a bug (or a feature ;-) All the best, Damian PS: If your using 5.10 or later and you find IO::Prompt useful, you might also be interested in its successor: IO::Prompter. It has a slightly different interface and feature set, but some nice additions you might find useful, not the least of which is that its feature set is fully documented!


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.