regarding date display

Paulo Casanova paulo.casanova at link.pt
Mon Mar 7 18:54:59 UTC 2005


Well, from perl documentation (man perlfunc) I got the following:

exec LIST
exec PROGRAM LIST
        The "exec" function executes a system command and never
        returns-- use "system" instead of "exec" if you want it to
        return.  It fails and returns false only if the command does
        not exist and it is executed directly instead of via your sys-
        tem's command shell (see below).

So I'm intrigued how your code works :)

Moving along, why not using Date::Format (or some other module?). Try 
this on you cgi:

use Date::Format;
@lt = localtime(time);
$vars->{'mydateval'} = strftime("%d-%m-%y");

Paulo


sundeep.kmr at wipro.com wrote:

> hi paulo,
>
>
> sorry to disturb 'u again..
>
> My problem is:-
>
> Code in enter_bug.cgi:--
>
> my $mydate = "date +%d-%m-%y";
> my $temp = exec($mydate);
> $vars->{'mydateval'} = $temp;
>
> In Corresponding html code is:--
>
> DATE:[% mydateval %]
>
>
> but it's Displaying
>
> DATE: 0
>
> I think its not executing the date command here.
>
> Thanking 'u
>
> thanks & regards,
> Sundeep
>
>
>
> Confidentiality Notice
>
> The information contained in this electronic message and any 
> attachments to this message are intended
> for the exclusive use of the addressee(s) and may contain confidential 
> or privileged information. If
> you are not the intended recipient, please notify the sender at Wipro 
> or Mailadmin at wipro.com immediately
> and destroy all copies of this message and any attachments.
>





More information about the developers mailing list