Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Re: padding/substr quirk

by ysth (Canon)
on Jan 11, 2004 at 06:52 UTC ( #320438=note: print w/replies, xml ) Need Help??

in reply to Re: padding/substr quirk
in thread padding/substr quirk

Or feed it to B::Deparse:
$ perl -MO=Deparse,-p #!perl use strict;use warnings; use Time::localtime; print "substr month= " . (substr("0" . localtime->mon() + 1, -2)) . "\ +n"; print "substr day= " . (substr("0" . localtime->mday(), -2)) . "\n"; print "sprintf month= " . (sprintf "%02d", localtime->mon() + 1) . "\n +"; print "sprintf day= " . (sprintf "%02d", localtime->mday()) . "\n"; ^D
which gives:
use Time::localtime; BEGIN {${^WARNING_BITS} = "UUUUUUUUUUUU"} use strict 'refs'; print((('substr month= ' . substr((('0' . localtime()->mon) + 1), (-2) +)) . "\n") ); print((('substr day= ' . substr(('0' . localtime()->mday), (-2))) . "\ +n")); print((('sprintf month= ' . sprintf('%02d', (localtime()->mon + 1))) . + "\n")); print((('sprintf day= ' . sprintf('%02d', localtime()->mday)) . "\n")) +;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://320438]
[marto]: Eily, there's actually a lot of good discussion on the topic in the HN link choroba posted
[marto]: sorry for the late response, busy busy :/
[Corion]: I think you need to load Readline in the debugger, but I don't know how
[Corion]: Yay, invitation for a team-building workshop, with a team of 100 people :-/
[Eily]: marto after an additional read I started to see the light actually. And choroba's link was helpful as well :)
[Corion]: I'll send my colleague who doesn't yet know the people there, and I'll do production duty instead.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2017-07-26 15:01 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (396 votes). Check out past polls.