[mrtg] Re: perl question, more or less

Rolen, Mark E. MERolen at APACMail.com
Tue Jun 6 18:54:59 MEST 2000


Well, I'm pretty much a hack, but this works:

---snip---

@time = (localtime(time));

$day     = $time[3];
$month   = $time[4] + 1;
$year    = $time[5] + 1900;

if ($day =~ /^.$/) { $day = "0$day" }
if ($month =~ /^.$/) { $month = "0$month" }

open (OUTFILE, ">$year$month$day"."in.html");

---snip---

and you'd be creating a file called 20000606in.html

I guarantee there's a cleaner way out there, but I'm not a perl guy.  If
someone else sends a better way to paul, include me, I'd be curious to see
it.

Later,
Mark




-----Original Message-----
From: Paul C. Williamson [mailto:pwilliamson at MANDTBANK.COM]
Sent: Tuesday, June 06, 2000 10:56 AM
To: dgabler at americomusa.net; mrtg at list.ee.ethz.ch; brian at mylinuxisp.com
Subject: [mrtg] perl question, more or less


Hi everyone,

This doesn't have much to do with mrtg, but there are some pretty good perl
people on the list, so I figured I'd shoot this question out to the
gallery...

How do I create a filename with the date embedded into it?  Right now, I
have a script that runs each night and collects the top talkers (thanks
Mark!) for the previous 34 hours.  I added some stuff and it automatically
creates a webpage for the information.  I would like a perl statement or
option that creates a file called "20000606in.html" (today's date plus
in.html) instead of just "in.html".  Any ideas?  I am sure there's something
out there to do this, I just haven't been able to find it.

Thanks,

Paul Williamson
Manager of EMS
M&T Bank Corporation


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org



More information about the mrtg mailing list