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


Including "date" in cgi file(perl)

Posted on 1999-06-30
Medium Priority
Last Modified: 2013-11-18
In my file I have included "date" variable:

print "$mydate\n";

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

Question by:saurav
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
LVL 84

Expert Comment

ID: 1213664

Accepted Solution

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

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