[17924] in Perl-Users-Digest
Perl-Users Digest, Issue: 84 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 17 21:05:37 2001
Date: Wed, 17 Jan 2001 18:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979783511-v10-i84@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 17 Jan 2001 Volume: 10 Number: 84
Today's topics:
Re: Can't get Apache, Win98, and Mod_Perl working. <oktay@torontonian.com>
Re: change STDIN and $/="" script to use (Richard J. Rauenzahn)
Finding user's IP address jzhang_97@my-deja.com
Re: Finding user's IP address <carvdawg@patriot.net>
Re: Fork lots of children <mischief@velma.motion.net>
How can I send my file to the printer in win98 by activ <jck1@seed.net.tw>
Re: Include file (Lou Hevly)
Re: Multiple Substitution (Tad McClellan)
Re: Multiple Substitution <elijah@workspot.net>
Need script help - consolidation <ewsr1@home.com>
Re: Newbie question: hash tables and dbm files; what am <nospam-abuse@[127.0.0.1]>
Re: Perl question (Dave)
perlcc for Win NT eacooper2085@my-deja.com
POD to powerpoint translator? <john_benavides@hp.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Jan 2001 23:50:25 GMT
From: Oktay <oktay@torontonian.com>
Subject: Re: Can't get Apache, Win98, and Mod_Perl working.
Message-Id: <3A663045.11F1F116@torontonian.com>
Hello
Try
http://www.indigostar.com/indigoperl.htm
He has a apache+perl+modperl for win32
it installs with a simple click and later using his perl script you can
add as many modules as you like with another click :)
Regards
shiloam@my-deja.com wrote:
>
> I am running Windows 98 and have successfully configured Apache 1.3.12
> to run just fine. I have recently installed ActivePerl and have been
> teaching myself the language. I have Perl 5.6.0 and I have downloaded
> the Mod_Perl apache from the Perl site as well. I cannot seem to get it
> working however. Everytime I try to use the LoadModule perl_module
> modules/ApacheModulePerl or LoadModule perl_module
> modules/ApacheModulePerl.dll it doesn't work, and gives me a can't load
> module error. When I try to register this dll using regsrv32 it says
> that it can't load the dll as well.
>
> If anyone knows how to get around this please let me know.
>
> Steve Tilden
> Instant Perl Fan
>
> Sent via Deja.com
> http://www.deja.com/
------------------------------
Date: 18 Jan 2001 00:13:44 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: change STDIN and $/="" script to use
Message-Id: <979776824.46676@hpvablab.cup.hp.com>
Michael de Beer <madebeer@igc.apc.org> writes:
>My main difficulty is that in part D) of my code, I parse the body in
>paragraph chunks. If I detect with regexp that the chunk I've just
>'eaten' has a 'From this@seperator date' line, that chunk will have the
>whole of the headers for the next message.
Then don't do it in paragraph chunks. The idiom I've used is...
$/ = "\nFrom ";
while(<DATA>) {
chomp;
$_ = "From " . $_ unless(/^From /s);
print ">>>>$_<<<<\n";
}
#
# You can skip the concatenation line if you don't
# care if the headers are perfect. The chomp
# is necessary or you'll get "From " at the end
# of your messages.
#
__DATA__
From me@somewhere Tue Jan 16 12:49:06 2001
Subject: foo
Hi there.
From someone@nowhere Tue Jan 16 12:49:06 2001
Subject: bar
Hello.
--
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant | I speak for me, | 19055 Pruneridge Ave.
Development Alliances Lab| *not* HP | MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014
------------------------------
Date: Wed, 17 Jan 2001 23:18:44 GMT
From: jzhang_97@my-deja.com
Subject: Finding user's IP address
Message-Id: <94598b$qun$1@nnrp1.deja.com>
I need to create a perl cgi script which tracks users' (or their proxy
servers') IP address, and translate them into their owners' name.
Someone mentioned that Net::Whois might be used for this, yet I would
like to find a short example using Net::Whois, and any other alternative
ways to accomplish this.
TIA.
John
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 17 Jan 2001 19:03:26 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: Finding user's IP address
Message-Id: <3A6632CD.C8068249@patriot.net>
How about something like this:
use strict;
use Socket;
my $target = shift || die "Must provide a hostname or IP address\n";
my($ip);
$ip = inet_ntoa(inet_aton($target));
print "Target:\t\t$target\n";
print "IP:\t\t$ip\n";
my ($name,$alias,$addrtype,$length,$new_addr) =
gethostbyaddr(inet_aton($ip),AF_INET) || die "Could not find host:
$!\n";
print "Hostname:\t$name\n";# if ($name ne $target);
print "Alias:\t$alias\n" if ($alias ne "");
jzhang_97@my-deja.com wrote:
> I need to create a perl cgi script which tracks users' (or their proxy
> servers') IP address, and translate them into their owners' name.
> Someone mentioned that Net::Whois might be used for this, yet I would
> like to find a short example using Net::Whois, and any other alternative
> ways to accomplish this.
>
> TIA.
>
> John
>
> Sent via Deja.com
> http://www.deja.com/
--
Q: Why is Batman better than Bill Gates?
A: Batman was able to beat the Penguin.
------------------------------
Date: Thu, 18 Jan 2001 00:40:28 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Fork lots of children
Message-Id: <t6cersol0vigc7@corp.supernews.com>
Tad Pepperling <tad@cyberconceptscorp.com> wrote:
> Chris,
> I am working on a project that we need to spawn multiple processes and for the
> life of me I can not get it to work.
Your have marked in the code someplace you want to start a fork, which is fine.
You then have a spot marked where you want to end the fork. This is not such
an easy matter. You no longer have one copy of the variables after forking.
You have one copy for each child. If, as in your program, you need to work
with these values after the childre return, then you need the children to
send that data to the parent in some way.
Shared memory, pipes, sockets, temp files, and a few other methods can be used
to handle passing the data back to the parent process.
perldoc perlipc mentions this:
# add error processing as above
$pid = open(KID_TO_READ, "-|");
if ($pid) { # parent
while (<KID_TO_READ>) {
# do something interesting
}
close(KID_TO_READ) || warn "kid exited $?";
} else { # child
($EUID, $EGID) = ($UID, $GID); # suid only
exec($program, @options, @args)
|| die "can't exec program: $!";
# NOTREACHED
}
The above shamelessly quoted code shows a parent forking a child,
the child execing an outside program, and the parent reading the
STDOUT of the child as the parent's filehandle KID_TO_READ.
At first glance around your code, I'd say this is a smart way to go.
I'd make a small, separate program that takes commandline arguments
about what page to get, uses LWP to get the page, and prints what
the parent program needs in $page to its STDOUT. I'd then exec that
program as from the child section above.
This way, you don't need to worry about ending the fork() cleanly,
because the child is done after the exec. You can treat the child
almost like a file in the parent section.
> I would love to invest more time in learning it but the 72 hours that I have
> in it so far tells me that I need to do something different.
> What the script does is use LWP to run queries on search engines and return
> the results. Whe we run a querie on 10 engines it takes between 30 seconds and
> 120 seconds. We are hoping that forking the process so that each search engine
> get quired at the same time instead of sequentially would cut down the time.
> Below is the code we are using..
[snip]
Wish I had time to help some more. This is an issue of rewriting major
sections of code to fix the problem properly. I hope I have pointed you in
a direction that's not too far off. I'm sure someone can help you with this
project, but I'm not sure it'd be within the scope of a one-post freebie.
Chris
--
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
-- Martien Verbruggen in clp.misc
------------------------------
Date: Thu, 18 Jan 2001 09:45:31 +0800
From: "writeman" <jck1@seed.net.tw>
Subject: How can I send my file to the printer in win98 by activeperl
Message-Id: <945i8g$lb5@netnews.hinet.net>
Hello,
I write a small script which can produce a file.
In the post, I open the file to print by the "MS Word".
But it is inconvenient. How can I print the file using the perl command.
I know the perl command "print" which I can refer the filehand.
But in the win98, not like the unix, the printer is not seen as device.
How can I do? And give me a example.
Thanks in advance,
Jck1
------------------------------
Date: Wed, 17 Jan 2001 23:46:44 GMT
From: lou@visca.com (Lou Hevly)
Subject: Re: Include file
Message-Id: <3a662e39.351405415@news.terra.es>
lorenzobeccati@mail.omnitel.it (Lorenzo Beccati) wrote:
>Is it possible to include a file where I've declared some variables
>from PL files ?
>
>In this way I can declare variables in this file and have them in all
>the PL files that I need.
Here's a very simple example to get you started; first create a
module:
--Myvars.pm--
package Myvars;
use strict;
require Exporter;
use vars qw(@ISA @EXPORT $basedir $email);
@ISA = qw(Exporter);
@EXPORT = qw($basedir $email);
$basedir = '/path/to/basedir';
$email = 'me@me.com';
1;
Then in your script you do:
#!/usr/bin/perl -w
use strict;
use lib '/path/to/modules'; # Put Myvars.pm in this directory
use NonAscii::Myvars;
print $basedir;
print $email;
Ciao.
--
All the best,
Lou Hevly
lou@visca.com
http://www.visca.com
------------------------------
Date: Wed, 17 Jan 2001 23:35:50 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Multiple Substitution
Message-Id: <slrn96c3le.2v4.tadmc@tadmc26.august.net>
Ron Grabowski <ronnie@catlover.com> wrote:
>> I believe the single quote is part of %encode, see the last line.
>>
>> %encode = ( '&' => '&',
>> '<' => '<',
>> '>' => '>',
>> '"' => '"',
>> '\'' => '&singleq;' );
>
>No,
Yes.
>its a slash followed by a single quote as everything between single
^^^^^^^^^^ no, not everything
>quotes are literals.
You didn't try it before posting it, did you?
Please do not do that. If you don't have time to test it, then
say so, or don't followup.
> "'" => '&signleq;'
>
>should do it. qq|'| or q|'| would also work.
Those should work just as well as the original.
I don't know what it was you were trying to improve, but I am
pretty sure that it has not been improved...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 18 Jan 2001 01:10:48 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Multiple Substitution
Message-Id: <eli$0101171954@qz.little-neck.ny.us>
In comp.lang.perl.misc, Ron Grabowski <ronnie@catlover.com> wrote:
> > %encode = ( '&' => '&',
> > '<' => '<',
> > '>' => '>',
> > '"' => '"',
> > '\'' => '&singleq;' );
>
> No, its a slash followed by a single quote as everything between single
> quotes are literals.
Wrong.
There is nothing wrong with not knowing something, but it is a
really bad thing to talk as if you know something whn you don't.
This is something you could have checked with a one line perl
program, but you didn't and instead spread misinformation.
Elijah
------
perl -we 'print reverse scalar reverse eval q Echr eval q W(eval q Qord q lLlQ
)-(eval q Qord q bBbQ)W E,reverse q JrekcahJ.q A lrepA.q P rehtonaP.q H tsujH'
------------------------------
Date: Wed, 17 Jan 2001 23:24:54 GMT
From: "bigdawg" <ewsr1@home.com>
Subject: Need script help - consolidation
Message-Id: <aRp96.19966$B6.5693611@news1.rdc1.md.home.com>
The following is a perl script that I wrote that works, but would be better
served using arrays. Help if you can please.
#!/usr/bin/perl
############################################################################
#
# CREATEBACKUPS.PL
#
# Description: Backs up selected files onto specified file server
# Output File: CreateBackups-<date>.txt log file
#
# Platform/OS: Intel/Windows NT
#
############################################################################
#
# DAILY
# -----
# Tricerat \\RICKY\M$\Program Files\Tricerat
# UPI \\CHAPLIN\Distsoft
# REPL \\RICKY\M$\Repl
# CFI Dep Pro \\ZEPPO\N$\CFI
# CFI Laser \\ETHEL\N$\CFI
# WinFAST \\SATCH\Windata
# SRC Program \\MUGSY\SRC
# SRC DB \\MUGSY\D$\MSSQL7\Backup
# DHCP \\Agarn\C$\WINNT\System32\DHCP
# PVBAPPS \\MUGSY\PVBAPPS
#
#---------------------------------------------------------------------------
-
# WEEKLY
# ------ IBS \\OPIE\Program
# USERS \\ABBOTT\Users
# BANK SHARES \\MUGSY\E$\Banks
#
#---------------------------------------------------------------------------
-
# MONTHLY
# ------- INSTALL \\SATCH\INSTALL
#
############################################################################
#
# -- Note that system calls return 0 if successful
############################################################################
#
# DEFINE MODULES and VARIABLES
############################################################################
#
use Win32::NetResource;
my $forcecopy = "0"; #set to 1 to force all routines to run
regardless
my $copy_tricerat = "1";
my $copy_UPI = "1";
my $copy_repl = "1";
my $copy_depositpro = "1";
my $copy_laserpro = "1";
my $copy_srcfiles = "1";
my $copy_pvbapps = "1";
my $copy_winfast = "1";
my $copy_dhcp = "1";
my $copy_srcdb = "1";
my $copy_ibs = "1";
my $copy_users = "1";
my $copy_bankshare = "1";
my $copy_install = "1";
my $copy_pvbapps = "1";
my $xcopyswitch = ' /E /C /H /R';
%NETRESOURCE=(LocalName=>"x:",RemoteName=>"\\\\snap1\\backups");
############################################################################
#
# MAIN
############################################################################
#
current_date();
#--------------------------------------------------------------------------
#- MAP NETWORK DRIVE
#-
#- Can't use UNC path to SNAP server because of nagging security problems
#- which hampered the continuous running of this script. So we'll map a
drive.
#- Also, we're in a catch 22 'cause you can't create a log unless a drive
is
#- mapped, and can't log the mapping without the mapped drive! So if
this fails,
#- you'll never know!
#---------------------------------------------------------------------------
system("if exist x: subst x: /d");
system("if exist x: net use x: /d");
Win32::NetResource::AddConnection(\%NETRESOURCE,$password,$user,0);
openlog();
if ($forcecopy == "1") {
copy_daily();
copy_weekly();
copy_monthly();
delete_daily();
delete_weekly();
delete_monthly();
closelog();
die;
}
if ($wday =~ /[1-5]/) {
copy_daily();
}
if ($wday == "6") {
copy_weekly();
}
if ($wday == "0" && $mday =~ /[25,26,27,28,29,30,31]/) {
copy_monthly();
}
delete_daily();
delete_weekly();
delete_monthly();
closelog();
#---DISCONNECT MAPPED DRIVE
Win32::NetResource::CancelConnection("x:",1,1);
############################################################################
#
# SUBROUTINES
############################################################################
#
#########################
# COPY DAILY
#########################
sub copy_daily {
#----CHECK FOR EXISTENCE OF DAILY DIR
$dailydir="x:\\daily";
unless (-e $dailydir) {
mkdir ($dailydir, 0777);
}
#---------------------------------
#- TRICERAT
#---------------------------------
if ($copy_tricerat == "1") {
$tricerat_src = "\\\\ricky\\m\$\\progra~1\\tricerat\\*.*";
$tricerat_bkpath = "x:\\daily\\$curdate\\tricerat\\";
unless (-e $tricerat_bkpath) {
mkdir ($tricerat_bkpath, 0777);
}
precopylog($tricerat_src, $tricerat_bkpath);
if (system("xcopy $tricerat_src $tricerat_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- UPI
#---------------------------------
if ($copy_UPI == "1") {
$upi_src = "\\\\chaplin\\distsoft\\*.*";
$upi_bkpath = "x:\\daily\\$curdate\\upi\\";
unless (-e $upi_bkpath) {
mkdir ($upi_bkpath, 0777);
}
precopylog($upi_src, $upi_bkpath);
if (system("xcopy $upi_src $upi_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- REPL
#---------------------------------
if ($copy_repl == "1") {
$repl_src = "\\\\ricky\\m\$\\repl\\*.*";
$repl_bkpath = "x:\\daily\\$curdate\\repl\\";
unless (-e $repl_bkpath) {
mkdir ($repl_bkpath, 0777);
}
precopylog($repl_src, $repl_bkpath);
if (system("xcopy $repl_src $repl_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- DEPOSIT PRO
#---------------------------------
if ($copy_depositpro == "1") {
$deppro_src = "\\\\zeppo\\n\$\\cfi\\*.*";
$deppro_bkpath = "x:\\daily\\$curdate\\deppro\\";
unless (-e $deppro_bkpath) {
mkdir ($deppro_bkpath, 0777);
}
precopylog($deppro_src, $deppro_bkpath);
if (system("xcopy $deppro_src $deppro_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- LASER PRO
#---------------------------------
if ($copy_laserpro == "1") {
$laser_src = "\\\\ethel\\n\$\\cfi\\*.*";
$laser_bkpath = "x:\\daily\\$curdate\\laser\\";
unless (-e $laser_bkpath) {
mkdir ($laser_bkpath, 0777);
}
precopylog($laser_src, $laser_bkpath);
if (system("xcopy $laser_src $laser_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- PVBAPPS
#---------------------------------
if ($copy_pvbapps == "1") {
$pvbapps_src = "\\\\Mugsy\\pvbapps\\*.*";
$pvbapps_bkpath = "x:\\daily\\$curdate\\pvbapps\\";
unless (-e $pvbapps_bkpath) {
mkdir ($pvbapps_bkpath, 0777);
}
precopylog($pvbapps_src, $pvbapps_bkpath);
if (system("xcopy $pvbapps_src $pvbapps_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- WINFAST
#---------------------------------
if ($copy_winfast == "1") {
$winfast_src = "\\\\Satch\\windata\\*.*";
$winfast_bkpath = "x:\\daily\\$curdate\\windata\\";
unless (-e $wibfast_bkpath) {
mkdir ($winfast_bkpath, 0777);
}
precopylog($winfast_src, $winfast_bkpath);
if (system("xcopy $winfast_src $winfast_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- SRC FILES
#---------------------------------
if ($copy_srcfiles == "1") {
$srcfiles_src = "\\\\mugsy\\src\\*.*";
$srcfiles_bkpath = "x:\\daily\\$curdate\\srcfiles\\";
unless (-e $srcfiles_bkpath) {
mkdir ($srcfiles_bkpath, 0777);
}
precopylog($srcfiles_src, $srcfiles_bkpath);
if (system("xcopy $srcfiles_src $srcfiles_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- SRC DB
#---------------------------------
if ($copy_srcdb == "1") {
$srcdb_src = "\\\\mugsy\\d\$\\mssql7\\backup\\*.*";
$srcdb_bkpath = "x:\\daily\\$curdate\\srcdb\\";
unless (-e $srcdb_bkpath) {
mkdir ($srcdb_bkpath, 0777);
}
precopylog($srcdb_src, $srcdb_bkpath);
if (system("xcopy $srcdb_src $srcdb_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- DHCP
#---------------------------------
if ($copy_dhcp == "1") {
runlogmsg("Stopping DHCP Server service on Agarn ...");
if (system("netsvc \\\\agarn \"Microsoft DHCP Server\" /stop")) {
runlogmsg("DHCP stopped")
} else {
runlogmsg("DHCP service did not stop!");
}
sleep 10;
$dhcp_src = "\\\\agarn\\c\$\\winnt\\system32\\dhcp\\*.*";
$dhcp_bkpath = "x:\\daily\\$curdate\\dhcp\\";
unless (-e $dhcp_bkpath) {
mkdir ($dhcp_bkpath, 0777);
}
precopylog($dhcp_src, $dhcp_bkpath);
if (system("xcopy $dhcp_src $dhcp_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
runlogmsg("Starting DHCP Server service on Agarn ...");
if (system("netsvc \\\\agarn \"Microsoft DHCP Server\" /start")) {
runlogmsg("DHCP started");
} else {
runlogmsg("DHCP service did not start!");
}
}
}
#########################
# COPY WEEKLY
#########################
sub copy_weekly {
#----CHECK FOR EXISTENCE OF MONTHLY DIR
$weeklydir = "x:\\weekly";
unless (-e $weeklydir) {
mkdir ($weeklydir, 0777);
}
#---------------------------------
#- IBS
#---------------------------------
if ($copy_ibs == "1") {
$ibs_src = "\\\\opie\\n\$\\program\\*.*";
$ibs_bkpath = "x:\\weekly\\$curdate\\ibs\\";
unless (-e $ibs_bkpath) {
mkdir ($ibs_bkpath, 0777);
}
precopylog($ibs_src, $ibs_bkpath);
if (system("xcopy $ibs_src $ibs_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- USERS
#---------------------------------
if ($copy_users == "1") {
$users_src = "\\\\satch\\users\\*.*";
$users_bkpath = "x:\\weekly\\$curdate\\users\\";
unless (-e $users_bkpath) {
mkdir ($users_bkpath, 0777);
}
precopylog($users_src, $users_bkpath);
if (system("xcopy $users_src $users_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
#---------------------------------
#- BANK SHARE
#---------------------------------
#----BANK SHARE FROM LUCY
if ($copy_bankshare == "1") {
$bankshare_src = "\\\\mugsy\\d\$\\banks\\*.*";
$bankshare_bkpath = "x:\\weekly\\$curdate\\banks\\";
unless (-e $bankshare_bkpath) {
mkdir ($bankshare_bkpath, 0777);
}
precopylog($bankshare_src, $bankshare_bkpath);
if (system("xcopy $bankshare_src $bankshare_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
}
#########################
# COPY MONTHLY
#########################
sub copy_monthly {
#----CHECK FOR EXISTENCE OF MONTHLY DIR
$monthlydir="x:\\monthly";
unless (-e $monthlydir) {
mkdir ($monthlydir, 0777);
}
#---------------------------------
#- INSTALL
#---------------------------------
if ($copy_install == "1") {
$install_src = "\\\\satch\\install\\*.*";
$install_bkpath = "x:\\monthly\\$curdate\\install\\";
unless (-e $install_bkpath) {
mkdir ($install_bkpath, 0777);
}
precopylog($install_src, $install_bkpath);
if (system("xcopy $install_src $install_bkpath $xcopyswitch")) {
failure();
} else {
success();
}
postcopylog();
}
}
#-----------------------
# DELETE DAILY
#-----------------------
sub delete_daily {
#-- will need to use DateCalc Perl module to do this
#-- don't have time to deal with right now
}
#-----------------------
# DELETE WEEKLY
#-----------------------
sub delete_weekly {
}
#-----------------------
# DELETE MONTHLY
#-----------------------
sub delete_monthly {
}
#-----------------------
# OPEN LOG
#-----------------------
sub openlog {
open(RUNLOG,">x:\\createbackups-$curdate.txt") ||
warn "Can't create log file\n";
select (RUNLOG); #--Makes the runlog the default filehandle
$~ = "LOGHEADER";
current_date();
$formatdate = "$mon/$mday/$year";
$logbegintime = "$hour:$min:$sec";
write(RUNLOG);
}
#-----------------------
# CLOSELOG
#-----------------------
sub closelog {
current_date();
$logendtime = "$hour:$min:$sec";
$~ = "LOGFOOTER";
write(RUNLOG);
close(RUNLOG) || warn "Can't close runlog\n";
}
#-----------------------
# CURRENT DATE
#-----------------------
sub current_date {
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
#---- Time function compensation
$year+=1900;
$mon++;
#---- Add zeros for proper date length
if ($mday < 10) {
$mday="0".$mday;
}
if ($mon < 10) {
$mon="0".$mon;
}
$curdate = $mon.$mday.$year;
}
#-----------------------
# RUNLOGMSG
#-----------------------
sub runlogmsg {
$runlogmsg = $_[0];
print " --- $runlogmsg\n";
$- --;
}
#-----------------------
# SUCCESS
#-----------------------
sub success {
$statusmsg = "OK";
}
#-----------------------
# FAILURE
#-----------------------
sub failure {
$statusmsg = "FAILED";
}
#-----------------------
# PRECOPYLOG (SUB)
#-----------------------
sub precopylog {
$from = $_[0];
$to = $_[1];
current_date();
$copybegintime = "$hour:$min:$sec";
$~ = "PRECOPYLOG";
write(RUNLOG);
}
#-----------------------
# POSTCOPYLOG (SUB)
#-----------------------
sub postcopylog {
current_date();
$copyendtime = "$hour:$min:$sec";
$~ = "POSTCOPYLOG";
write(RUNLOG);
}
############################################################################
#
# FORMATS
############################################################################
#
#-----------------------
# PRECOPYLOG (FORMAT)
#-----------------------
format PRECOPYLOG =
--------------------------------------------------------------
Copying from: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$from
to: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$to
Begin Time: @<<<<<<<<
$copybegintime
.
#-----------------------
# POSTCOPYLOG (FORMAT)
#-----------------------
format POSTCOPYLOG =
End Time: @<<<<<<<<
$copyendtime
------------------------- [@|||||] -------------------------
$statusmsg
.
#-----------------------
# LOGHEADER
#-----------------------
format LOGHEADER =
=====================================================================
CREATEBACKUPS.PL RUN LOG @<<<<<<<<<
$formatdate
------- Contact: 410-347-8456
=====================================================================
LOGGING STARTED AT: @<<<<<<<<
$logbegintime
.
#-----------------------
# LOGFOOTER
#-----------------------
format LOGFOOTER =
LOGGING ENDED AT: @<<<<<<<<
$logendtime
************************** END OF REPORT **************************
=====================================================================
.
------------------------------
Date: Wed, 17 Jan 2001 20:29:32 -0500
From: "James Kauzlarich" <nospam-abuse@[127.0.0.1]>
Subject: Re: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <4Gr96.4208$d25.25912@newsfeed.slurp.net>
> Hmm. I don't remember when CGI was included in the perl distribution.
> It's been a while, but it is now. Your vendor must be behind the
> times, eh?
My bad. I was tired and posted before I'd double checked what it was
called. I ment to say...ummm.... Ahh. Can't find my "perl in a nutshell".
(I'm at work, so I'm limited to the books can carry in.) It's the small
modual that allows you to code and decodes URLs and some other stuff.
[Don't shoot me if I use the wrong terminology, just correct me 8) ]
jmk
--
do NOT remove the nospam from the repy to address above,
instead send email to o1tech(at)skyenet(dot)net
JAPN 8_(
------------------------------
Date: 18 Jan 2001 00:06:09 GMT
From: david.obrien@ssmb.com.au (Dave)
Subject: Re: Perl question
Message-Id: <Xns902D70F16655Fdavidobrienssmbcomau@169.191.104.95>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in
<943rf1$58m$1@mamenchi.zrz.TU-Berlin.DE>:
>Dave <david.obrien@ssmb.com.au> wrote in comp.lang.perl.misc:
>>> $line =~ s/****//g;
>>
>>Sorry this is totally wrong. Not reading your post I guess. Need to
>>strip the rest of the line.
>
>This doesn't compile (you need to escape '*' in a regex if you mean
>it literally). So you posted code, found an apparent error in it and
>posted again, never bothering to run it through Perl even once.
>
>Test your code before posting. If you can't for some reason (no such
>reason here), then say that it's untested. There's no excuse for
>posting code with syntax errors.
>
>Anno
You are right sorry.
--
"If I was five years younger. I'd take a flamethrower to this place!" Al
Pacino
------------------------------
Date: Thu, 18 Jan 2001 01:17:14 GMT
From: eacooper2085@my-deja.com
Subject: perlcc for Win NT
Message-Id: <945g6j$16i$1@nnrp1.deja.com>
Hello,
I would like to compile my perl program to an a standalone
executable. I have the ActivePerl software and perlcc gives a message
saying it is very experimental. Is there reliable software to do this?
thanks in advance,
Eric
eric.cooper@clarent.com
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 17 Jan 2001 19:03:55 -0600
From: John Benavides <john_benavides@hp.com>
Subject: POD to powerpoint translator?
Message-Id: <3A6640FB.8497CD74@hp.com>
Has anyone built a POD to PowerPoint translator?
I would like to display some of my module work
in PowerPoint and wondered if someone has already
cooked this up?
Regards,
John
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ John Benavides | Hewlett Packard - HPSL +
+ 3000 Waterview Parkway | e-mail: john_benavides@hp.com +
+ Richardson, TX 75080 | (972) 497-4771 Fax: (972) 497-4500 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 84
*************************************