Skip to content

Poor handling of undefined values #8

@barefootcoder

Description

@barefootcoder

This:

[cibola:~] perl -MDate::Easy -le 'print datetime(undef)'
Use of uninitialized value $datetime in pattern match (m//) at /home/buddy/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/Date/Easy/Datetime.pm line 44.
Use of uninitialized value $datetime in concatenation (.) or string at /home/buddy/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/Date/Easy/Datetime.pm line 52.
Illegal datetime:  at -e line 1.

should be far less noisy. If the arg is undefined, it could short-circuit all the work it's trying to do and just throw an exception immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions