Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Including "date" in cgi file(perl)

Posted on 1999-06-30
2
Medium Priority
?
305 Views
Last Modified: 2013-11-18
Hi,
In my test.pl file I have included "date" variable:

$mydate=`date`
print "$mydate\n";

But while I run test.pl from MS/DOS, the perl program outputs today's date after i "enter twice" after typing test.pl !!
Also when I include the above two lines in my .cgi script(perl), today's date does not show up!

saurav
0
Comment
Question by:saurav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1213664
$mydate=localtime;
0
 
LVL 1

Accepted Solution

by:
wilfrieds earned 40 total points
ID: 1213665
This seems definitely not the way to get the date in Perl.  It looks to me as if you're trying to get the result of the MSDOS command date into a variable.
You have to use Perl's time function instead.
localtime(time) will give you a 9-element array which a.o. includes today's day.

Cfr. Camel book p. 159
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question