Perl script with lock to execute only once in a day

Hi,

I am new to perl and have a script to which i want to ensure that no matter how many ever times i execute the script it should execute only once per day. Cronjob is not a safe method as I want to built in capability inside the script.

Do you want to create the "lock" in perl or in shell?