[16052] in Perl-Users-Digest
Perl-Users Digest, Issue: 3464 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 23 14:05:36 2000
Date: Fri, 23 Jun 2000 11:05:19 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961783519-v9-i3464@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 23 Jun 2000 Volume: 9 Number: 3464
Today's topics:
Accessing a Win32 DLL's global variables? mgreenwood@tqs.com
Re: Anyone use ActivePerl on Win95 or Win98 <jllawhead@sunherald.com>
Bogus newsgroup comp.lang.perl (was: Re: Error in POSIX <rootbeer@redcat.com>
Re: Bogus newsgroup comp.lang.perl (was: Re: Error in P <care227@attglobal.net>
browser doesn't display images <T.Veit@psi-bt.de>
Re: browser doesn't display images <bill.kemp@wire2.com>
Re: browser doesn't display images (Samuel A. Mullen)
Re: browser doesn't display images <lilleyb001@hawaii.rr.com>
Can't Use OLE bayers@my-deja.com
Re: Can't Use OLE <rootbeer@redcat.com>
checking that a process is not running <andrew.g.bacchi@hitchcock.NOSPAM.org>
Re: checking that a process is not running <care227@attglobal.net>
Re: chomp on Array? <aqumsieh@hyperchip.com>
Concatenate String <joeb@jagas.demon.co.uk>
Re: Concatenate String <tony_curtis32@yahoo.com>
Re: Concatenate String <tina@streetmail.com>
Re: Concatenate String <care227@attglobal.net>
Re: Concatenate String <panderse@us.ibm.com>
Re: Creating a cause from information. (Anno Siegel)
Re: Creating a cause from information. <smerr612@mailandnews.com>
dbi oracle - newbie question jude_carter@my-deja.com
delaying Sendmail command <raphaelp@nr1webresource.com>
Re: eof for sendmail .. (Villy Kruse)
Re: Error in POSIX.pm when using signal handlers (M.J.T. Guy)
Re: Error in POSIX.pm when using signal handlers (M.J.T. Guy)
Re: Error in POSIX.pm when using signal handlers <care227@attglobal.net>
How can I Use a Perl Script to FTP files automatically <bruceNObrSPAM@mccausland.com.invalid>
Re: How can I Use a Perl Script to FTP files automatica <thunderbear@bigfoot.com>
Re: How can I Use a Perl Script to FTP files automatica <billy@arnis-bsl.com>
Re: How can I Use a Perl Script to FTP files automatica <wgshi@newby.cs.ualberta.ca>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 23 Jun 2000 16:01:38 GMT
From: mgreenwood@tqs.com
Subject: Accessing a Win32 DLL's global variables?
Message-Id: <8j01kl$6eh$1@nnrp1.deja.com>
I am using the Win32::API module to make function calls to a Win32
DLL. So far, no problem. Wrapping up these functions was pretty easy.
The problem is that many of the functions in this library update global
variables to report status and error codes. Yes, this is not the way I
would have done it, either, but unfortunately it is rather compelling
for me to use this legacy library, which was written to provide a C
language interface.
My question is, is there any way (and can someone point me to
documentation) within Perl to not only call the functions in this DLL
(which Win32::API does just fine) but also to check the updated values
of its global variables?
(In case it's important, the application is control of GPIB instruments
and the DLL contains the standard IEEE-488 functions).
Thanks,
Mark
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 16:30:02 GMT
From: Joel <jllawhead@sunherald.com>
Subject: Re: Anyone use ActivePerl on Win95 or Win98
Message-Id: <sl744ajfe7f51@corp.supernews.com>
You can use either c:\perl\bin or c:\perl\bin\perl
Ferk Da Jerk wrote:
>
>
> I downloaded ActivePerl. All the stuff was installed in the folder
> C:\Perl\. When you work on a Unix system the heading would be
> #!/usr/local/bin/perl but not on Windows. What am I supposed to replace it
> with?
>
>
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Fri, 23 Jun 2000 10:57:29 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Bogus newsgroup comp.lang.perl (was: Re: Error in POSIX.pm when using signal handlers)
Message-Id: <Pine.GSO.4.10.10006231054470.10836-100000@user2.teleport.com>
On Fri, 23 Jun 2000, Drew Simonis wrote about the bogus newsgroup
comp.lang.perl:
> That NG will never die. Lots of posters still in it. I know its
> on the servers I read from.
Of course, that's no excuse; it should be removed from those servers.
There's a frequent posting in news.announce.newgroups about "Bogus Usenet
Groups" which explains about this issue. Here's an older copy of this
message, showing that c.l.p hasn't existed since 1995(!); the explanation
is at the end of the message.
http://www.ou.edu/research/electron/internet/use-bogu.htm
A fairly up-to-date (and quite lengthy) list of current newsgroups may
be downloaded from one of these URLs.
ftp://ftp.uu.net/uunet-info/newsgroups.gz
ftp://ftp.uu.net/uunet-info/newsgroups.Z
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 23 Jun 2000 13:59:48 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Bogus newsgroup comp.lang.perl (was: Re: Error in POSIX.pm whenusing signal handlers)
Message-Id: <3953A594.DCA77E35@attglobal.net>
Tom Phoenix wrote:
>
> A fairly up-to-date (and quite lengthy) list of current newsgroups may
> be downloaded from one of these URLs.
>
> ftp://ftp.uu.net/uunet-info/newsgroups.gz
> ftp://ftp.uu.net/uunet-info/newsgroups.Z
I look at http://sunsite.doc.ic.ac.uk/usenet/usenet-by-hierarchy/
Also regularly updated.
------------------------------
Date: Fri, 23 Jun 2000 17:32:08 +0200
From: "Torsten Veit" <T.Veit@psi-bt.de>
Subject: browser doesn't display images
Message-Id: <8ivvq4$lqe$1@wrath.news.nacamar.de>
Hi,
in Perl I try to dynamically insert jpg-images into html. But the browser
shows everything but the images. In the browser if I check the properties of
the images, the path and the name is correct.
perl-statements:
$imgm="image1.jpg";
...
print "<img src=\"",$imgm,"\" align=bottom width=64 height=64>\n";
What is wrong?
Any hints or suggestions?
Thanks, Torsten
------------------------------
Date: Fri, 23 Jun 2000 16:41:09 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: browser doesn't display images
Message-Id: <961774992.15100.0.nnrp-09.c3ad6973@news.demon.co.uk>
Probably best in a cgi group?
>in Perl I try to dynamically insert jpg-images into html. But the browser
>shows everything but the images. In the browser if I check the properties
of
>the images, the path and the name is correct.
>
>perl-statements:
>
>$imgm="image1.jpg";
>...
>print "<img src=\"",$imgm,"\" align=bottom width=64 height=64>\n";
>
If your browser is internet explorer and the page is called with a form
action 'POST',
I might have experienced this.
Try GET -> should be OK.
Try netscape -> should be OK.
Try preloading the image in a previous page -> should be OK (until you clear
your cache).
If the above is true it seems to be a MSIE bug - I have no better
explanation.
------------------------------
Date: Fri, 23 Jun 2000 15:47:10 GMT
From: smullen@oppunl.com (Samuel A. Mullen)
Subject: Re: browser doesn't display images
Message-Id: <slrn8l71tr.ugj.smullen@smullen.oppunl.com>
Have you checked permissions (Unix only)?
chmod 644 image1.jpg
You also might try using absolute paths just to see if that works. It
would give you a good starting place to look for problems if it does.
Sam
* Torsten Veit <T.Veit@psi-bt.de> [Fri, 23 Jun 2000 17:32:08 +0200]:
> Hi,
>
> in Perl I try to dynamically insert jpg-images into html. But the browser
> shows everything but the images. In the browser if I check the properties of
> the images, the path and the name is correct.
>
> perl-statements:
>
> $imgm="image1.jpg";
> ...
> print "<img src=\"",$imgm,"\" align=bottom width=64 height=64>\n";
>
> What is wrong?
>
> Any hints or suggestions?
>
> Thanks, Torsten
>
>
--
_____________________
/ Samuel A. Mullen \
| Programmer Analyst |_______________________________________________
| Opportunities Unl. | He that refuseth instruction despiseth his \
\_____________________/| own soul: but he that heareth reproof getteth |
| understanding. |
| Proverbs 15:32 |
\_______________________________________________/
------------------------------
Date: Fri, 23 Jun 2000 16:59:13 GMT
From: "Benji Lilley" <lilleyb001@hawaii.rr.com>
Subject: Re: browser doesn't display images
Message-Id: <BHM45.8169$aB6.36407@typhoon.hawaii.rr.com>
For one, you should use the absolute path name ...
If you do use the absolute path name and the images doesn't show then either
your server software is not configured to allow posting images from the
directory the image is in, or the process that the cgi is runnig in (usually
'nobody') doesn't have permission to view the file.
Hope this helps.
Ben
Torsten Veit <T.Veit@psi-bt.de> wrote in message
news:8ivvq4$lqe$1@wrath.news.nacamar.de...
> Hi,
>
> in Perl I try to dynamically insert jpg-images into html. But the browser
> shows everything but the images. In the browser if I check the properties
of
> the images, the path and the name is correct.
>
> perl-statements:
>
> $imgm="image1.jpg";
> ...
> print "<img src=\"",$imgm,"\" align=bottom width=64 height=64>\n";
>
> What is wrong?
>
> Any hints or suggestions?
>
> Thanks, Torsten
>
>
------------------------------
Date: Fri, 23 Jun 2000 15:18:33 GMT
From: bayers@my-deja.com
Subject: Can't Use OLE
Message-Id: <8ivv3n$46a$1@nnrp1.deja.com>
This bit of cgi code crashes. It's in a plx file:
use Win32::OLE;
print "Content-type: text/html\n\n";
print "i";
This runs fine:
#use Win32::OLE;
print "Content-type: text/html\n\n";
print "i";
As does this:
use strict;
print "Content-type: text/html\n\n";
print "i";
When run from the command line, this code, in a pl file, works fine:
use Win32::OLE;
$Conn = CreateObject Win32::OLE "ADODB.Connection";
$Conn->Open("DSN=MSSQL;UID=user;PWD=password");
$Conn->Open("SQL");
$RS = $Conn->Execute("SELECT * FROM TIMECLOK");
while ( !$RS->EOF ) {
my($Author, $Title) = (
$RS->Fields('ID')->value,
$RS->Fields('NAME')->value);
print $Author, " : ", $Title, "\n";
$RS->MoveNext;
}
$RS->Close;
$Conn->Close;
I'm using activestate perl version 5.22 on NT4 with IIS4. I originally
had 5.005 and tried upgrading to 5.6 but couldn't get the ppm hotfix to
work. I then installed 5.22. I'm at a loss for other things to try.
Thanks in advance.
- Jim
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 10:46:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Can't Use OLE
Message-Id: <Pine.GSO.4.10.10006231042540.10836-100000@user2.teleport.com>
On Fri, 23 Jun 2000 bayers@my-deja.com wrote:
> Newsgroups: comp.lang.perl.misc, comp.lang.perl.module
Perhaps you meant "comp.lang.perl.modules" there.
> This bit of cgi code crashes. It's in a plx file:
>
> use Win32::OLE;
> print "Content-type: text/html\n\n";
> print "i";
Well, that's not HTML! But that's a quibble. Maybe you can make this one
work to tell you something. It won't produce valid HTML either. :-)
use CGI::Carp qw/ fatalsToBrowser /;
use Win32::OLE;
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 23 Jun 2000 12:46:40 -0400
From: Andrew Bacchi <andrew.g.bacchi@hitchcock.NOSPAM.org>
Subject: checking that a process is not running
Message-Id: <39539470.1FBBF320@hitchcock.NOSPAM.org>
I'm writing a short perl scrip to switch the httpd log file on the first
of each month. I need to stop the httpd server and then check that it
is not running before making the log file switch. I'm not sure if my
code is exactly perl centric. Is my $exist line correctly done?.
Is this correct: if ($exist != " "), if the httpd server were
stopped, would this be the best way to check and then make the rename?
Please review and make suggestions for improvement. Thanks in advance.
#!/usr/bin/perl -w
# This script creates a new Apache Access log file and renames the old
file with the date appended the the original name.
# The script runs from crontab on the first day of the month.
use strict;
`/usr/local/apache/bin/apachectl stop`; # Stop the Apache web
server.
my $exist = `ps -A | grep httpd`; # Check that httpd is not
running.
my ($DAY, $MONTH, $YEAR) = (localtime)[3,4,5]; #Scaler vars for
appending the date stamp to the old log file.
if ($exist != " "){ # If the web server did
indeed stop, rename the old log and create the new log file.
`mv apache.log apache.log.$DAY$MONTH$YEAR`;
`touch apache.log`;
}
`/usr/local/apache/bin/apachectl sslstart'; # Restart the Apache web
server.
------------------------------
Date: Fri, 23 Jun 2000 13:04:13 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: checking that a process is not running
Message-Id: <3953988D.5F88BE92@attglobal.net>
Andrew Bacchi wrote:
>
> Is this correct: if ($exist != " "), if the httpd server were
^^^
!= is a numeric test.
ne is a string test.
Since you are testing to see if it is not equal to a space, I would
think you need to use ne.
> Please review and make suggestions for improvement. Thanks in advance.
>
> #!/usr/bin/perl -w
> use strict;
>
> `/usr/local/apache/bin/apachectl stop`; # Stop Apache
You could do something like:
$results = qx(/usr/local/apache/bin/apachectl stop);
This allows you to see the output of the stop command, if any.
Then a regex match could be used to ensire that the process stopped.
> my $exist = `ps -A | grep httpd`; # Check for httpd
If the server has stopped, $exist won't have alot in it. But then:
> if ($exist != " "){
You test to see if is numerically equal to a space. Assuming you
change that to a string compare, are you sure it will just have a
space?
------------------------------
Date: Fri, 23 Jun 2000 17:37:32 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: chomp on Array?
Message-Id: <7avgz0guxs.fsf@merlin.hyperchip.com>
"Markachev, Naiden [SKY:4Y21:EXCH]" <naidenm@americasm01.nt.com> writes:
> chomp works on both types scalars and lists. In case of a list though it
> removes trailing '\n' from all members of that list if present.
^^^^
^^^^
Not exactly. It removes the character defined in $/ from the end of each
line in the array. By default, $/ is "\n" (not '\n', which is two
characters). But nothing prevents you from changing $/, which affects
chomp() directly.
Of course, all of this is discussed in the docs. So the OP should have
consulted perldoc before posting.
--Ala
------------------------------
Date: Fri, 23 Jun 2000 18:03:26 +0100
From: JoeB <joeb@jagas.demon.co.uk>
Subject: Concatenate String
Message-Id: <3953985D.A403CB27@jagas.demon.co.uk>
Hello,
How do I concatenate a string?
I have this:
@body = "This is the body";
@body .= "And more ...."; - This line doesn't work
I am getting the following error:
Can't modify array deref in concatenation at xxx.pl line xx
Please help.
------------------------------
Date: 23 Jun 2000 12:07:53 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Concatenate String
Message-Id: <87lmzwjpg6.fsf@limey.hpcc.uh.edu>
>> On Fri, 23 Jun 2000 18:03:26 +0100,
>> JoeB <joeb@jagas.demon.co.uk> said:
> Hello, How do I concatenate a string?
> I have this:
> @body = "This is the body";
> @body .= "And more ...."; -> This line doesn't work
@body is an array. A string is a scalar.
$body = "...";
$body .= "...";
<tangent>
If you want to use an array to represent *lines*
individually, then
push @body, $another_line;
and then either join() or string-interpolate the array
when you output it (actually I would prefer this because
an array of lines presumably matches the "real world"
better, esp. if any editing of array contents is
involved).
</tangent>
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: 23 Jun 2000 17:10:57 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Concatenate String
Message-Id: <8j05n1$5jsum$3@fu-berlin.de>
hi,
JoeB <joeb@jagas.demon.co.uk> wrote:
> How do I concatenate a string?
first you should read
perldoc perldata
$string is a string, @array is an array, and %hash is a hash.
> @body = "This is the body";
so you're assigning a string to an array?
> @body .= "And more ...."; - This line doesn't work
replace the "@" with "$" and it will work.
you should use
#!/usr/bin/perl -w
use strict;
use diagnostics;
that will help you giving you more detailed error messages.
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
"The Software required Win98 or better, so I installed Linux."
------------------------------
Date: Fri, 23 Jun 2000 13:09:08 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Concatenate String
Message-Id: <395399B4.4ACDB79C@attglobal.net>
JoeB wrote:
>
> Hello,
>
> How do I concatenate a string?
>
> I have this:
>
> @body = "This is the body";
$body may contain a string. @body is an array. Kinda like a stack
of strings. You need to tell perl which piece of the array you want
to modify:
@body[4] = "This is the body";
> @body .= "And more ...."; - This line doesn't work
>
To add entries to an array (put more things on the pile), you use
the push() function.
$ perldoc -f push
To join strings together, you use either the . operator (as in
$string . $string1) or the join() function. There are, of course,
other ways as well, but these are the easiest.
$ perldoc -f join
$ perldoc perlop
HTH
------------------------------
Date: Fri, 23 Jun 2000 12:40:10 -0500
From: "Paul R. Andersen" <panderse@us.ibm.com>
Subject: Re: Concatenate String
Message-Id: <3953A0FA.C7B7F626@us.ibm.com>
JoeB wrote:
>
> Hello,
>
> How do I concatenate a string?
>
> I have this:
>
> @body = "This is the body";
> @body .= "And more ...."; - This line doesn't work
>
> I am getting the following error:
>
> Can't modify array deref in concatenation at xxx.pl line xx
>
@body is not a string, it is an array.
$body = "This is the body";
$body .= "And more ....";
will work.
--
Paul Andersen
+++++++++++++
The difference between theory and practice is that in theory there is no
difference between theory and practice; but in practice there is.
------------------------------
Date: 23 Jun 2000 15:47:48 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Creating a cause from information.
Message-Id: <8j00r4$q2g$1@lublin.zrz.tu-berlin.de>
<malverian@my-deja.com> wrote in comp.lang.perl.misc:
>
>> For a quick check, replace $data = <SOCK> with $data = $_. You should
>> get about twice as many trips through the loop. Then you can do away
>> with $data altogether and work with $_ instead. This will simplify a
>> few things.
>>
>> Anno
>>
>
>I am still slightly confused.. will this speed up or slow down my
>program? You said it will to through the loop twice as many times..
It won't run longer, it will run right. If you are saving time
now, you are saving it by ignoring each other line.
>One other question..
>If alot of information was coming through the socket, are you saying I
>am losing data and it is sometimes not triggering the ifs when I read
>it into $data?
It doesn't have to do with sockets at all. Just create a small
test file, open that instead of a socket, and try the two loop
designs, printing the lines as you go. You'll understand better
than by any explanation.
Anno
------------------------------
Date: Fri, 23 Jun 2000 16:07:08 GMT
From: Steven Merritt <smerr612@mailandnews.com>
Subject: Re: Creating a cause from information.
Message-Id: <8j01us$6k6$1@nnrp1.deja.com>
In article <8ivs44$1s3$1@nnrp1.deja.com>,
malverian@my-deja.com wrote:
> I am still slightly confused.. will this speed up or slow down my
> program? You said it will to through the loop twice as many times..
Both. It will put every line through your ifs instead of every other
line, so processing time will possibly double, but you'll have optimized
the regex and read so they're on the same wavelength(both writing to
and reading from the same place in memory), and they'll perform faster.
> One other question..
> If alot of information was coming through the socket, are you saying I
> am losing data and it is sometimes not triggering the ifs when I read
> it into $data?
The problem is that you're using the magical angle brackets <> on your
filehandle as the only condition of a while loop. These read a line
from the filehandle every iteration of the while loop(and only when you
use it in a while loop) and put it into $_. So what you've done is
basically do two reads, an implicit read, and an explicit read, per
iteration of the loop. This is listed as a "common goof" in the book
_Programming Perl_ You do own a copy of _Programming Perl_ don't you?
>while(<SOCK>)
# this reads a line from the filehandle and stores it in $_
>{
> $data = <SOCK>;
# this reads another line from the filehandle(using the magic of <>) and
# stores it in $data.
# The <> usually just means grab a line from the filehandle. It's only
# when you put it as the only arguement of a while loop that you get the
# behavior that's frustrating you, the implicit read to $_.
> #etc...
So you're reading two lines each iteration. One gets put into your
variable and tested, the other gets overwritten the next time through
the loop. A minimal change to fix this would just be to change the
assignement from
$data = <SOCK>;
to
$data = $_;
If you don't want to go through and change all your if statements, but
as others have noted you'll lose some performance here because you'll
make your regex engine look outside it's default search space if you use
a defined varaible($data) to hold the current line instead of the
built-in variable($_).
Steven
--
King of Casual Play
The One and Only Defender of Cards That Blow
My newsreader limits sigs to four lines, but I cleverly bypassed this by
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 15:35:42 GMT
From: jude_carter@my-deja.com
Subject: dbi oracle - newbie question
Message-Id: <8j004c$53s$1@nnrp1.deja.com>
I'm trying to look up rows in an oracle table using a flat file for the
key values to look up. I find that it will fail a match on character
fields if there are less characters in the field than the total size of
the field.
So... If I've got a list like:
asdf
lll
qwer
and want to match (on column fred) to a table like:
FRED|GEORGE (both 4 char columns)
asdf,fdsa
qwer,rewq
lll ,kkk
Then the two 4char matches will be fine, but the last will bomb.
Regardless of putting in spaces, quotes or whatever into the
flatfile...
I'm new to both dbi and oracle. (not to mention perl!) so I don't know
exactly where this is falling over. Anybody got any ideas?
...
# Prepare once only then get ? values from a flat file <LIST> ...
my $sql = $dbh->prepare('SELECT * FROM dbitest WHERE fred = ?')
or die "fuct prepare\n\n" . $sql->errstr;
while ($input = <LIST>) {
my @data;
chop $input;
print "Searching for $input\n";
$sql->execute($input)
or die "fuct execute: " . $sql->errstr;
while (@data = $sql->fetchrow_array()) {
my $col1 = $data[0];
my $col2 = $data[1];
print "\tFound: COL1: $col1 \t COL2: $col2\n\n";
}
if ($sql->rows == 0) {
print "\tNo Match on `$input'.\n\n";
}
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 17:32:40 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: delaying Sendmail command
Message-Id: <8j0393$68b$16$1@news.t-online.com>
Hi,
I have an autoresponder that I don't want to send out right away. I want to
be able to say, for instance, that the Autoresponder will wait 30 minutes in
the "Outbox" before being sent out. Is this possible?
Regards,
Raphael Pirker
raphaelp@nr1webresource.com
------------------------------
Date: 23 Jun 2000 15:57:48 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: eof for sendmail ..
Message-Id: <slrn8l727s.gb7.vek@pharmnl.ohout.pharmapartners.nl>
On Fri, 23 Jun 2000 09:49:21 -0400,
Drew Simonis <care227@attglobal.net> wrote:
>Villy Kruse wrote:
>>
>>
>> By the way, the eof to sendmail is like any other eof to any other program
>> you might be piping to. You send it when you close the pipe.
>>
>> However, you might need the -oi option or you might cut your message short
>> if you happen to send a period all alone on a line.
>>
>
>Or send a period all alone to end the message.
Then you need to deal with the hidden dot algorith or your message might
get garbeled. Better to set the -oi flag to sendmail to ignore the period
all alone on a line and leave the lines starting with a period as is.
The normal file close will do just nicely.
Villy
------------------------------
Date: 23 Jun 2000 17:29:04 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Error in POSIX.pm when using signal handlers
Message-Id: <8j06p0$n1e$1@pegasus.csx.cam.ac.uk>
Stephen Ludin <sludin@aeneid.com> wrote:
> Newsgroups: comp.lang.perl,comp.lang.perl.misc
The newsgroup comp.lang.perl has not existed for many years. Please
ask your newsadmin to remove it.
>When I use the below code and run with the'-w' switch I get the following
>the first ( and only the first ) time my CHLD signal handler is called:
>
>Argument "CHLD" isn't numeric in subroutine entry at
>/usr/local/lib/perl5/5.6.0/alpha-dec_osf/POSIX.pm
>
>Here is a smple script. It is pretty much textbook code.
>
>------------------------------------------------------
>use POSIX ":sys_wait_h";
>
>$SIG{CHLD} = \&sh_child;
>
># spawn children here
>
>sub sh_child
>{
> my $child;
>
> while( ($child = POSIX::waitpid( -1, &POSIX::WNOHANG )) > 0 )
> {
> # do something with $child and $?
> }
>
>}
Ouch! Seeing code like that hurts.
Not that it's your fault - Perl has dug a rather nasty pit for you here.
First off: Signals aren't safe in Perl (yet). So you should do as
little as possible in a signal handler. And keep your fingers crossed.
"But I'm doing almost nothing in the signal handler."
True. But Perl is doing lots of things behind your back. The
constants in the POSIX module are AUTOLOADed. So they're only
defined when they are first evaluated. And that happens in the signal
handler. So POSIX::AUTOLOAD is called and does various threshing
about ....
Yukkk!
The workaround is to force the constant to be loaded earlier, e.g. by
writing
use POSIX ":sys_wait_h";
BEGIN { POSIX::WNOHANG };
Mike Guy
------------------------------
Date: 23 Jun 2000 17:39:24 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Error in POSIX.pm when using signal handlers
Message-Id: <8j07cc$nj2$1@pegasus.csx.cam.ac.uk>
M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>Stephen Ludin <sludin@aeneid.com> wrote:
>> Newsgroups: comp.lang.perl,comp.lang.perl.misc
>
>The newsgroup comp.lang.perl has not existed for many years. Please
>ask your newsadmin to remove it.
... and then I forget to remove it from Newsgroups: line.
Sorry folks.
Mike Guy
------------------------------
Date: Fri, 23 Jun 2000 13:43:31 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Error in POSIX.pm when using signal handlers
Message-Id: <3953A1C3.1175DD76@attglobal.net>
"M.J.T. Guy" wrote:
>
> M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
> >Stephen Ludin <sludin@aeneid.com> wrote:
> >> Newsgroups: comp.lang.perl,comp.lang.perl.misc
> >
> >The newsgroup comp.lang.perl has not existed for many years. Please
> >ask your newsadmin to remove it.
>
> ... and then I forget to remove it from Newsgroups: line.
>
That NG will never die. Lots of posters still in it. I know its
on the servers I read from.
------------------------------
Date: Fri, 23 Jun 2000 08:05:42 -0700
From: fortbruce <bruceNObrSPAM@mccausland.com.invalid>
Subject: How can I Use a Perl Script to FTP files automatically
Message-Id: <0a2211be.596a0f1e@usw-ex0105-034.remarq.com>
I need some assistance setting-up a Perl script that will do the
following:
- Take files that are placed in a directory on a SUN UNIX box
(large photos) and FTP them to another UNIX machine in a
specific directory.
- After the file has been FTP'd, the original file can be
deleted (removed) from the source directory.
I would like to set this up so that the parameters are easily
modified at the top of the script as below:
#!/usr/local/bin/perl
#
# Initializations
$source = "/usr/home/photos/out";
$destipaddr = "138.135.134.132"
$destpath = "/usr/home/ftp/photos/in/";
Keep in mind that these directories & ip addresses are bogus
here.
I am supposed the be going to a Perl scripting course (finally)
sometime next month, but the need for the script is immediate
and I am just learning Perl. I know you "Perl pros" out there
are snickering because this would be so easy for you, but I
would really appreciate your assistance.
Thanks!
Humbly Yours,
Bruce
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Fri, 23 Jun 2000 17:27:57 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: How can I Use a Perl Script to FTP files automatically
Message-Id: <395381FD.B94C0F88@bigfoot.com>
fortbruce wrote:
> I need some assistance setting-up a Perl script that will do the
> following:
Use Net::FTP to do the transfer. There are some examples to get you
started in the "perldoc Net::FTP" page.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: Fri, 23 Jun 2000 15:49:21 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: How can I Use a Perl Script to FTP files automatically
Message-Id: <8j00tp$5mh$1@nnrp1.deja.com>
In article <0a2211be.596a0f1e@usw-ex0105-034.remarq.com>,
fortbruce <bruceNObrSPAM@mccausland.com.invalid> wrote:
> I need some assistance setting-up a Perl script that will do the
> following:
>
> - Take files that are placed in a directory on a SUN UNIX box
> (large photos) and FTP them to another UNIX machine in a
> specific directory.
>
About FTP transfers see the FAQ: "How do I fetch/put an FTP file?".
It may be found in your 'perldoc perlfaq9'
or http://www.cpan.org/doc/manual/html/pod/perlfaq9.html.
> - After the file has been FTP'd, the original file can be
> deleted (removed) from the source directory.
>
To remove the file you may use unlink() function.
See 'perldoc -f unlink'
or http://www.cpan.org/doc/manual/html/pod/perlfunc/unlink.html
for more details.
> I would like to set this up so that the parameters are easily
> modified at the top of the script as below:
> #!/usr/local/bin/perl
> #
> # Initializations
>
> $source = "/usr/home/photos/out";
> $destipaddr = "138.135.134.132"
> $destpath = "/usr/home/ftp/photos/in/";
>
You may even pass them to your script as
command-line parameters. Search 'perldoc perlvar' or
http://www.cpan.org/doc/manual/html/pod/perlvar.html
for @ARGV description.
> Keep in mind that these directories & ip addresses are bogus
> here.
>
> I am supposed the be going to a Perl scripting course (finally)
> sometime next month, but the need for the script is immediate
> and I am just learning Perl. I know you "Perl pros" out there
> are snickering because this would be so easy for you, but I
> would really appreciate your assistance.
>
Hope this helps.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 10:23:23 -0600
From: Weiguang Shi <wgshi@newby.cs.ualberta.ca>
To: fortbruce <bruceNObrSPAM@mccausland.com.invalid>
Subject: Re: How can I Use a Perl Script to FTP files automatically
Message-Id: <Pine.LNX.4.10.10006231018070.6359-100000@newby.cs.ualberta.ca>
Hi,
I got into exactly your problem months ago and got it solved by using the
Net::FTP module. It's easy as the man page of it gives an example like
this:
use Net::FTP;
$ftp = Net::FTP->new("some.host.name", Debug => 0);
$ftp->login("anonymous",'me@here.there');
$ftp->cwd("/pub");
$ftp->get("that.file");
$ftp->quit;
The disadvantage is that the password has to be supplied and transmitted
transparent. May be some guru can tell how can do it securely.
Weiguang
------------------------------
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 V9 Issue 3464
**************************************