Lucky001 has asked for the wisdom of the Perl Monks concerning the following question:

perl -MNet::Domain::ExpireDate -e '$x=expire_date('abc.com');print $x;' ""Why its not working"

Replies are listed 'Best First'.
Re: Expire date of domain
by Eily (Monsignor) on Oct 13, 2014 at 14:27 UTC

    perl -MNet::Domain::ExpireDate -e '$x=expire_date('abc.com');print $x;' ""Why its not working"
    You have single quotes both as script delimiter and inside the script:
    perl -e 'print ('acb.com');' -> abccom
    You are calling "expire_date" with parameter abccom.

Re: Expire date of domain
by blue_cowdawg (Monsignor) on Oct 13, 2014 at 14:14 UTC

    Seems a quick RTFM is in order here. Please note the following:

    $expiration_obj = expire_date( 'microsoft.com' ); $expiration_str = expire_date( 'microsoft.com', '%Y-%m-%d' ); $expiration_obj = expdate_int( $whois_text, 'com' ); $expiration_str = expdate_fmt( $whois_text, 'ru', '%Y-%m-%d' +);
    This works fine:
    # perl -MNet::Domain::ExpireDate -e 'print expire_date("microsoft.com" +,"%Y-%m-%d"),"\n"' 2021-05-03


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; Blog: http://blog.berghold.net Warning: No political correctness allowed.
Re: Expire date of domain
by choroba (Cardinal) on Oct 13, 2014 at 13:58 UTC
    Hi Lucky001, welcome to the Monastery!

    What do you mean by "not working?" Is there no output, or do you get output different to your expectations (in such a case, what did you expect)? Or is there an error message? What does it say?

    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ