http://www.perlmonks.org?node_id=1047654


in reply to Date function

It looks like you can display the current date and time. You just need to subtract 24 hours from now to get to yesterday.
localtime( time() - (24 * 60 * 60) );
Combine that with strftime() and youre done.

EDIT (after comment below): Make sure your timezone is set correctly too.