Skip to content

Instantly share code, notes, and snippets.

@zmughal
Last active August 29, 2015 14:03
Show Gist options
  • Save zmughal/710a327a5103c0c14a23 to your computer and use it in GitHub Desktop.
Save zmughal/710a327a5103c0c14a23 to your computer and use it in GitHub Desktop.
DateTime does stringify
2014-06-29T21:49:50
----
PDL does not stringify
0
#!/usr/bin/env perl
use strict;
use warnings;
use v5.16;
use DateTime;
say "DateTime @{[ does_it_stringify( DateTime->now ) ]} stringify";
say DateTime->now;
say "----";
use PDL;
say "PDL @{[ does_it_stringify( pdl() ) ]} stringify";
say pdl();
sub does_it_stringify {
defined overload::Method( $_[0] , '""' ) ? "does" : "does not";
}
@zmughal
Copy link
Author

zmughal commented Jul 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment