[11671] in Perl-Users-Digest
Perl-Users Digest, Issue: 5271 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 31 18:04:21 1999
Date: Wed, 31 Mar 99 15:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 31 Mar 1999 Volume: 8 Number: 5271
Today's topics:
<STDIN> <eslater@frinc.com>
Re: @INC Problem (Randal L. Schwartz)
Re: Atlanta User Group (brian d foy)
Controlling the duration of a process (Kaiser)
Help Please with CGI (Solder182)
Re: HELP! Can't figure out matching $a and /$[b]/ (Greg Bacon)
Re: HELP! Can't figure out matching $a and /$[b]/ (Larry Rosler)
how to dereference a package variable evrim@my-dejanews.com
Re: my random doesn't return number!! <ddelikat@protix.com>
Re: my random doesn't return number!! (Larry Rosler)
Re: my random doesn't return number!! <tbriles@austin.ibm.com>
My script wont add to database (db) costner@my-dejanews.com
Perl Compiler <sales@adultscripts.com>
perl subroutine help magicratusa@my-dejanews.com
Re: printing to LPT1 <ozette.brown@infotechfl.com>
problems with 'require'. <APTavistock@lbl.gov>
Re: Question: Odd If-Else problem. <kprice@cardinal.co.nz>
Re: random elements from an array (Abigail)
Re: Regex with lookahead help (Larry Rosler)
Resource required (Adam Reynolds)
Re: Running a perl script as a daemon.... <ddelikat@protix.com>
Sendmail errors to ME and not the SERVER admin <benne@village.uunet.be>
Re: strange ERROR mssg scraig@my-dejanews.com
Re: strange ERROR mssg (George)
Timing a download <justisd@mnl.com>
Re: Use of Require in Win32 <nospam@here.com>
Re: which database to use in perl (Abigail)
Re: Why won't this work? (Larry Rosler)
Re: Why won't this work? <mamster@mamster.net>
Re: www.pm.org (brian d foy)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 31 Mar 1999 16:14:26 -0500
From: "Elliot Slater" <eslater@frinc.com>
Subject: <STDIN>
Message-Id: <7du37a$fpt$1@nntp3.uunet.ca>
Am I able to assign a value to <STDIN> as I would any other variable?
Thanks,
Elliot
------------------------------
Date: 31 Mar 1999 13:01:58 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: @INC Problem
Message-Id: <m1677hl6ex.fsf@halfdome.holdit.com>
>>>>> "Bill" == Bill Williams <biwillia@cisco.com> writes:
Bill> Jens Engelbrecht wrote:
Jens> Hello,
Jens>
Jens> I wrote a cgi script using the modul LWP::Simple.
Jens> By running the script on the server I get the following error:
Jens>
Jens> "Can't locate LWP/simple.pm in @INC (@INC contains:
Jens> /usr/lib/perl5/i586-linux/5.00404 /usr/lib/perl5
Jens> /usr/lib/perl5/site_perl/i586-linux /usr/lib/perl5/site_perl .) at
Jens> crawler.pl line 9.
Jens> BEGIN failed--compilation aborted at crawler.pl line 9."
Jens>
Jens> The correct path to LWP::Simple is " /usr/lib/perl5/site_perl/LWP " .
Jens> Thanks for helping.
Jens>
Jens> Jens Engelbrecht
Bill> use the following syntax:
Bill> use lib '/usr/lib/perl5/site_perl/LWP';
Not unless the file is actually:
/usr/lib/perl5/site_perl/LWP/LWP/Simple.pm
which I somewhat doubt. Although, if it's up a level, the existing @INC
should work. Hmm. Looks like someone didn't use Makefile.PL to install
this thing. :)
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 31 Mar 1999 17:18:31 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Atlanta User Group
Message-Id: <comdog-ya02408000R3103991718310001@news.panix.com>
In article <7dti6m$k5c$1@camel0.mindspring.com>, "Michael Courter" <mcourter@mindspring.com> posted:
> i'm looking for the where-abouts of the Atlanta Perl User Group. if anyone
> has any knowledge of this UG please forward some info to me.
http://atlanta.pm.org/
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 31 Mar 1999 22:34:10 GMT
From: kaiser@prm.REMOVETHIS.se (Kaiser)
Subject: Controlling the duration of a process
Message-Id: <3702a030.13994273@news1.tninet.se>
Hello
I'm writing a script that checks all URL's in a Netscape bookmark
file. Everything works just fine but I want some extra functionality.
Most important is that I want the LWP:UserAgent, that I use to check
the URL's with, to stop working after a defined length of time. Then
signal a time out and move on to the next URL. How do I do? AFAIK I
can't make some kind of loop because that would start multiple
instances of the agent.
Any help or direction would be very appreciated.
TIA
/Peter
***************************
Peter Olsson
mailto:p@prm.se
http://www.prm.se/peo/
***************************
------------------------------
Date: 31 Mar 1999 21:46:26 GMT
From: solder182@aol.com (Solder182)
Subject: Help Please with CGI
Message-Id: <19990331164626.10297.00000524@ng-ch1.aol.com>
I just need someone preferably to make the altercations in the script cause I
keep on doing it and messing, up I am on virtualave.net. Please contact me if
you can help. Thanks
Digital Explorer
ICQ-5989580
AIM-DigitalEx1
http://members.tripod.com/nzhero/
"Knowledge Is Power"
------------------------------
Date: 31 Mar 1999 21:03:50 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: HELP! Can't figure out matching $a and /$[b]/
Message-Id: <7du2jm$nof$2@info2.uah.edu>
In article <7du151$ftr$1@nnrp1.dejanews.com>,
pkuhar@my-dejanews.com writes:
: I think this line is my problem:
I think you're right. :-)
: if ($input{'userid'} =~ /[$reguser]/){
: print "thanks.";
: }
: else {
: print "go away";
: }
:
: The problem is, when $input{'userid'} is
: flo, and imho $reguser is florence, it prints
: thanks. I ONLY WANT IT TO PRINT THANKS IF THERE'S
: AN EXACT MATCH!
As the perlre manpage will tell you, [] delimit a character class,
i.e. an expression that matches a character if and only if that
character is in the set of characters between the brackets. For
example,
$str =~ /[aeiou]/;
will succeed when $str contains a lowercase vowel. You probably want
something more like
if ($input{'userid'} eq $reguser) {
print "thanks.";
}
Greg
--
If a tree falls in the forest and nobody hears it, is Bambi squashed beneath
it any less dead?
-- Mason Capwell
------------------------------
Date: Wed, 31 Mar 1999 13:22:53 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HELP! Can't figure out matching $a and /$[b]/
Message-Id: <MPG.116c320951d0d583989801@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7du151$ftr$1@nnrp1.dejanews.com> on Wed, 31 Mar 1999
20:38:58 GMT, pkuhar@my-dejanews.com <pkuhar@my-dejanews.com> says...
> Help please! I will really be grateful!
> I am having a LOT of trouble, I just started
> programming Perl recently.
I hope you have invested in "Learning Perl" from O'Reilly and
Associates. In any event, your perl installation provides lots of
documentation (for example, perlre for regular expressions), and if by
some evil chance they aren't there, find them on the web (from
http://www.perl.com/).
> I think this line is my problem:
>
> if ($input{'userid'} =~ /[$reguser]/){
It is.
> The problem is, when $input{'userid'} is
> flo, and imho $reguser is florence, it prints
> thanks. I ONLY WANT IT TO PRINT THANKS IF THERE'S
> AN EXACT MATCH!
You must be pretty upset to shout like that. It's not worth it. :-)
What you have asked for is a match against any of the characters '$' 'r'
'e' 'g' 'u' or 's'. So it succeeds. That is what the square brackets
mean -- a 'character class'.
If you leave them out, you will match any string that contains
'florence', such as 'xflorencex'. To fix that, replace the square
brackets by '\b' (signifying word boundary).
But ultimately, regexes are not the best way to check for exact matches.
That is what the 'eq' operator is for:
if ($input{'userid'} eq $reguser) {
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 Mar 1999 22:42:36 GMT
From: evrim@my-dejanews.com
Subject: how to dereference a package variable
Message-Id: <7du8cr$mlr$1@nnrp1.dejanews.com>
Hi. I am using somehitng liek:
Package A;
<...>
$z="A";
$x=$$z::i;
hoping to get A::i
but it does not work. It works when I have
$z="A::i"
$x=$$z;
I need to get the package name (A or B or whatever) from a variable.
How can I do it using the first method?
-e
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 31 Mar 1999 14:58:49 -0600
From: David Delikat <ddelikat@protix.com>
Subject: Re: my random doesn't return number!!
Message-Id: <37028C89.7566@protix.com>
Larry Rosler wrote:
>
> [Posted and a courtesy copy mailed.]
>
> In article <37027790.4487@protix.com> on Wed, 31 Mar 1999 13:29:20 -
> 0600, David Delikat <ddelikat@protix.com> says...
> > Yannick Girard wrote:
> ...
> > > $rand_key = $keys[int rand @keys];
> ...
> >
> > try this:
> >
> > $rand_key = $keys[int rand $#keys];
>
> Sorry, dav. That never gets to the last element in the array. Ever.
> `perldoc -f rand`:
neither will '@keys' in a scalar context it evaluates to
<trumpet fanfare> '$#keys'
why on earth would I want the last element in the array?
the code is generating a valid index, if my memory serves me
in any way, the last element in the array ( #4 or 5 ) is a 3 digit
number. this would not give me acceptable results.
Larry, I do not know what it is that you do. but I'm a programmer.
please don't tell me my business.
I'd appretiate it if you would take your own advice.
also, learn to read code.
>
> Returns a random fractional number greater than or equal to 0 and less
> than the value of EXPR. ...
>
> Please season your responses with a pinch of documentation and
> experimentation!
>
> To add a tiny bit of value to this thread: Putting 'int' into array
> indexes is overkill, because the truncation to int takes place
> automatically (DWIM).
>
> --
> Larry Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
-dav
--
<((((><
Consultant: Internet, Database, Business Systems
Unix/Linux, Windows95/NT
mailto:david-delikat@usa.net / http://obj.webjump.com/
------------------------------
Date: Wed, 31 Mar 1999 13:47:16 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: my random doesn't return number!!
Message-Id: <MPG.116c37bf9fd4f457989802@nntp.hpl.hp.com>
[Posted and a dis-courtesy copy mailed.]
In article <37028C89.7566@protix.com> on Wed, 31 Mar 1999 14:58:49 -
0600, David Delikat <ddelikat@protix.com> says...
> Larry Rosler wrote:
> > In article <37027790.4487@protix.com> on Wed, 31 Mar 1999 13:29:20 -
> > 0600, David Delikat <ddelikat@protix.com> says...
> > > Yannick Girard wrote:
> > ...
> > > > $rand_key = $keys[int rand @keys];
> > ...
> > DD> try this:
> > DD>
> > DD> $rand_key = $keys[int rand $#keys];
> >
> LR> Sorry, dav. That never gets to the last element in the array. Ever.
> LR> `perldoc -f rand`:
>
> neither will '@keys' in a scalar context it evaluates to
> <trumpet fanfare> '$#keys'
Do you really think so? In private email I explained this to you, but
you forgot to tell me you had also put your nonsense online.
...
> Larry, I do not know what it is that you do. but I'm a programmer.
> please don't tell me my business.
>
> I'd appretiate it if you would take your own advice.
> also, learn to read code.
This is the point at which many members of this newsgroup would say
'PLONK', meaning (in case you don't know) that you are not worth
listening to any more, and you are wasting my time, so I don't want ever
to see any of your messages.
But it is far too much fun for me, watching you make an ass of yourself
in your first appearance in this newsgroup.
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 Mar 1999 15:35:52 -0600
From: Tom Briles <tbriles@austin.ibm.com>
Subject: Re: my random doesn't return number!!
Message-Id: <37029538.D495FE69@austin.ibm.com>
David Delikat wrote:
> Larry Rosler wrote:
> >
> > [Posted and a courtesy copy mailed.]
> >
> > In article <37027790.4487@protix.com> on Wed, 31 Mar 1999 13:29:20 -
> > 0600, David Delikat <ddelikat@protix.com> says...
> > > Yannick Girard wrote:
> > ...
> > > > $rand_key = $keys[int rand @keys];
> > ...
> > >
> > > try this:
> > >
> > > $rand_key = $keys[int rand $#keys];
> >
> > Sorry, dav. That never gets to the last element in the array. Ever.
> > `perldoc -f rand`:
>
> neither will '@keys' in a scalar context it evaluates to
> <trumpet fanfare> '$#keys'
Umm...no it doesn't. This incredibly simple concept is explained by
reading the docs:
perldoc perldata
> why on earth would I want the last element in the array?
> the code is generating a valid index, if my memory serves me
> in any way, the last element in the array ( #4 or 5 ) is a 3 digit
> number. this would not give me acceptable results.
I have no idea what that is supposed to mean...
> Larry, I do not know what it is that you do. but I'm a programmer.
> please don't tell me my business.
Ho boy...
I hesitate to even reply to that, but if you want to know what it is that
Larry does, check the web page in his signature. I'd wager large sums that
his accomplishments dwarf yours.
> I'd appretiate it if you would take your own advice.
I didn't see any direct advice. If you are inferring a recommendation to
read the docs, then it certainly is *good* advice.
> also, learn to read code.
Kids say the darnedest things...
- Tom
------------------------------
Date: Wed, 31 Mar 1999 20:46:56 GMT
From: costner@my-dejanews.com
Subject: My script wont add to database (db)
Message-Id: <7du1ju$g75$1@nnrp1.dejanews.com>
I have downloaded and tried to make work about 3 different Perl scripts.
I have spent HOURS at this ...I am begging you to tell me what to do to fix
this problem.
the following script is showing itself ok, when I add something it says it was
added, but the count does not change and nothing is actually added to
random/data.db
would you look at this please?
http://www.thepage.org/random/rando.cgi?12345
I have chmod 'd til I am blue in the face
please help,
desperately
CJ
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 31 Mar 1999 21:36:19 GMT
From: "Sales Team" <sales@adultscripts.com>
Subject: Perl Compiler
Message-Id: <7du4gj$l4q$1@comet3.magicnet.net>
I am looking for some help with the Perl complier...
Any information would be greatly appreciated...
Is it available...?
--
-Hank...
http://www.connor-miller.com
hank@connor-miller.com
Office -
(407) 905-0600
(407) 905-0510 Fax
------------------------------
Date: Wed, 31 Mar 1999 22:30:02 GMT
From: magicratusa@my-dejanews.com
Subject: perl subroutine help
Message-Id: <7du7ku$m2o$1@nnrp1.dejanews.com>
Hi, I am trying to use a web interface to launch a perl program in the
background. Basically, I want the user to press a button to launch the
program, and receive a response (html page) that confirms that the script has
been started. My problem is that I can't get the response page to print
before the script finishes running. Overall, I want to return a new page
where the user can hit another button and launch another instance of the
program while the previous one is running, passing different parameters.
Unfortunately, this is in an NT environment so I don't believe I can use
multi-threading. But if anyone has any other ideas, please advise.
Otherwise, any way to return the response page while the program is running?
Sample of code below.
Thanks for your help.
>>
>>
if (($FORM{'form_name'}) eq "robot_start") {
@College_Build = ();
for($z=$start_record;$z<=$end_record;$z++) {
@Temp_College_Build = ();
$element1 = $Final_College_Info[$z][0];
$element2 = $Final_College_Info[$z][1];
$element3 = $Final_College_Info[$z][2];
$element4 = $Final_College_Info[$z][3];
push (@Temp_College_Build, $element1, $element2, $element3, $element4);
push (@College_Build, [ @Temp_College_Build ]);
}
print "<html><body>Running robot<br>\n";
print "Start record is $start_record<br>\n";
print "End record is $end_record<br>\n";
print "End of test printout\n</body></html>";
robot_start(@College_Build);
return 1;
}
Andy
andy@agevision.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 31 Mar 1999 17:02:01 -0500
From: Ozette Brown <ozette.brown@infotechfl.com>
Subject: Re: printing to LPT1
Message-Id: <37029B59.6321F8A4@infotechfl.com>
Dave,
Try a form feed here:
open( PORT, "+>LPT1" ) or die "Can't open LPT1: $!";
print PORT "testing\f";
close(PORT);
See if that works.
Ozette
Dave McIntyre wrote:
> Does anyone know if you can print directly to LPT1 on NT?
> In the ActiveState FAQ it says you can open a serial port
> directly, ie:
>
> open( PORT, "+>COM1" ) or die "Can't open COM1: $!";
>
> So I'm wondering if you can do the same to LPT1.
> I tried:
>
> open( PORT, "+>LPT1" ) or die "Can't open LPT1: $!";
> print PORT "testing";
>
> with no success.
>
> Thanks,
> Dave McIntyre
--
Ozette Brown <Ozette.Brown@Infotechfl.com>
Webmaster - Systems Analyst, Infotech Inc.
5700 S.W. 34th St. Suite 1235 Phone: 352-375-7624
Gainesville, FL 32608-5371 Fax: 352-373-9586
------------------------------
Date: Wed, 31 Mar 1999 14:07:18 -0800
From: Aaron Tavistock <APTavistock@lbl.gov>
Subject: problems with 'require'.
Message-Id: <37029C96.E242F42F@lbl.gov>
I have a wierd issue that someone might be able to answer.
I've tried to seperate a some fairly sizable code into two sections; An
engine and a configs file. I'm trying to read in the config file into
the engine code using require. This works if I do NOT use the strict
pragma, but only because I do not have to declare the variables.
I'm having a hard time explaining this in non-perl. So, Heres a code
example of the problem
_test.conf_
$value = "test string";
_test.pl_
use strict;
my ($value);
require 'test.conf';
print "$value\n";
The results of this will be nothing. I've tried forcing the namespace
in both files to be main, that doesn't help. I've tried declaring the
variable in a BEGIN block, but that seems to make the variable disappear
from the main namespace entirely (do 'use strict' and BEGIN work
together?).
Any good insite into this?
Aaron Tavistock
------------------------------
Date: Thu, 01 Apr 1999 09:00:56 +1200
From: Kelvin Price <kprice@cardinal.co.nz>
Subject: Re: Question: Odd If-Else problem.
Message-Id: <37028D08.582631E2@cardinal.co.nz>
Ed wrote:
>
> I've encountered an odd error with the following section of a simple
> script. The problem section is included below. The problem I'm having
> is that the print immediately after the delete prints fine, but nothing else
> will print, even the print after the if-else construct. I look in the
> database and
> the delete is deleting the correct records. BTW: I have a standard
> subroutine
> to print the html header information with a background, and the header and
> background is being output.
>
> I called my web provider to ask them if they had any suggestions, and
> their response was, "I spoke to our PERL guru and we saw that it doesn't
> work."
>
> I would appreciate any help that anyone could give. E-mail (
> euston@mindspring.com) is fine.
>
> Thanks in advance,
>
> Edward
>
> script follows:
>
> if (defined($class{$title})) {
>
> delete($class{$title});
>
> print qq|
> <h3> $title deleted #3.
> |;
>
> if (!exists($class{$title})) {
> print qq|
> <h3> $title deleted.
> |;
> }
> else {
> print qq|
> <h3> $title delete unsuccesful.
> |;
> }
**********************************************************************
I think that } looks lonely, maybe you should set him up with a nice ;
**********************************************************************
>
> print qq|
> <h3> I just skipped the if - else.
> |;
> }
------------------------------
Date: 31 Mar 1999 22:16:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: random elements from an array
Message-Id: <7du6r9$jl0$1@client2.news.psi.net>
Jonathan Feinberg (jdf@pobox.com) wrote on MMXXXVIII September MCMXCIII
in <URL:news:m3zp4t3eef.fsf@joshua.panix.com>:
;; "TinP" <tgj@snip..net> writes:
;;
;; > How can you take a random element of an array yet not randomly
;; > choose it again?
;;
;; my $element = splice(@array, rand @array, 1);
That's linear in the length of the array (unless you're lucky).
my $i = int rand @array;
@array [$i, $#array] = @array [$#array, $i];
my $element = pop @array;
has a running time independent of the length of the array.
See also the FAQ.
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
------------------------------
Date: Wed, 31 Mar 1999 13:02:30 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regex with lookahead help
Message-Id: <MPG.116c2d44aa6538499897ff@nntp.hpl.hp.com>
In article <37027AD2.2781E494@ks.sel.alcatel.de> on Wed, 31 Mar 1999
21:43:14 +0200, William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
says...
> Arthur Newhall wrote:
> > I am having trouble creating a regex to do this
> > "match everything up to the first % that isn't preceded by a \"
...
> > %aaa --> nul
...
> > aaa\%bbb --> aaa\
...
> my @a = qw(aa\%bbb%ccc aaa%bbb %aaa aaa\%bbb%ccc aaa%bbb%ccc aaa\%bbb);
> foreach $a (@a) {
> (my $good) = $a =~ /^(.*?[^\\])%/;
> printf "had: '%s' found: '%s'\n", $a, defined $good ? $good :
> "undef";
> };
/^((?:.*?[^\\])?)%/
takes care of the first case shown above ('%aaa'). But I haven't worked
out the second yet ('aaa\%bbb'). For one thing, it's not clear from the
problem statement what to do with a string without an unescaped '%'.
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 Mar 1999 22:52:28 GMT
From: adamr@craze.co.uk (Adam Reynolds)
Subject: Resource required
Message-Id: <3703a654.14199545@news.demon.co.uk>
I am looking for a book review system. ie
www.craze.co.uk/cgi-bin/review.pl?prod0001
Would enable an indivdual to comment on product prod0001, preferably
with some sort of email/password system to prevent minor misuse.
If anybody knows of one out there please could they email me?
adamr@craze.co.uk
I will also monitor this group.
Adam
Craze Limited
------------------------------
Date: Wed, 31 Mar 1999 15:12:55 -0600
From: David Delikat <ddelikat@protix.com>
Subject: Re: Running a perl script as a daemon....
Message-Id: <37028FD7.3359@protix.com>
Greg Bacon wrote:
>
> In article <37026B6C.2F1C@protix.com>,
> David Delikat <ddelikat@protix.com> writes:
> : oh for crying out loud, I just joined this group and the first thing I
> : see is some bonehead picking on spelling, and it isn't even wrong.
>
> Oh, for crying out loud! I've been reading this newsgroup for a long
> time, and I constantly see boneheads delurking before they ought to.
> Those boneheads are invariably wrong. :-(
>
> Greg
> --
> Artifical insemination is when the farmer does it to the cow instead of the
> bull.
> -- Funny Answers to Science Test Questions
maybe I was wrong to come back.
--
<((((><
Consultant: Internet, Database, Business Systems
Unix/Linux, Windows95/NT
mailto:david-delikat@usa.net / http://obj.webjump.com/
------------------------------
Date: Thu, 1 Apr 1999 00:38:35 +0200
From: "Benne" <benne@village.uunet.be>
Subject: Sendmail errors to ME and not the SERVER admin
Message-Id: <7du85o$33g$1@nickel.uunet.be>
Hi,
I have a mailinglist "subscribe me".
When I send a newsletter to all my subscribers, my SERVER admin gets the
error messages for the e-mails that not could be delivered. (wrong email) He
has to forward these by hand back to me.
How can I make "sendmail" to send error messages directly to my email
address and not the server?
$mailprog = '/bin/sendmail -t';
please advise me
thank's
------------------------------
Date: Wed, 31 Mar 1999 21:44:11 GMT
From: scraig@my-dejanews.com
Subject: Re: strange ERROR mssg
Message-Id: <7du4v9$jei$1@nnrp1.dejanews.com>
In article <3700E063.786313FB@atmm.nl>,
Marc Bakker <mbakker@atmm.nl> wrote:
> I got this error message upon compiling (perl -c) my code:
>
> Illegal character \015 (carriage return) at get_top_ten.pl line 2.
> (Maybe you didn't strip carriage returns after a network transfer?)
I'm guessing that you probably wrote your script on a windows machine, and
then invoked it on a unix machine. The problem arises because the two
operating systems treat line endings differently.
In a windows text editor, such as notepad, presing the enter key inserts
two characters into the file, a carriage return and a linefeed, \015\012.
Under Unix, the same key only inserts a linefeed, \012. So when the perl
executable on unix reads the file with your script, it breaks it into lines
using \012, giving the impression that every line ends with a \015 character.
The wierd solution usually suggested is to FTP the script from your hard
drive to the unix box. FTP fixes the line endings for you.
A simpler solution is to use a more flexible editor, such as PFE, the
Programmer's File Editor, which can save files in either format, or even
convert from one to the other. Search the net for "PFE" to find out where to
download it (for free).
It is also pssible to strip the \015 characters using s/\015//, perhaps in
interactive mode.
HTH
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 31 Mar 1999 17:04:45 -0500
From: fred222@mauimail.com (George)
Subject: Re: strange ERROR mssg
Message-Id: <fred222-ya023580003103991704450001@news.bellatlantic.net>
In article <3700E063.786313FB@atmm.nl>, Marc Bakker <mbakker@atmm.nl> wrote:
> Hi all
>
> I got this error message upon compiling (perl -c) my code:
>
> Illegal character \015 (carriage return) at get_top_ten.pl line 2.
> (Maybe you didn't strip carriage returns after a network transfer?)
>
> I see nothing unusual at line 2 - and yes, there is a CR.
>
> What does it mean?
>
> Marc,
> zmbakker@xs4all.nl
It just means that you did not upload your script in ASCII mode generally.
Make sure to always upload scripts in ASCII mode, never binary.
Best regards,
George
--
Just another hacking head >l-d
------------------------------
Date: Wed, 31 Mar 1999 14:54:16 -0600
From: Justis <justisd@mnl.com>
Subject: Timing a download
Message-Id: <37028B78.89087742@mnl.com>
Hello,
I am wondering how to go about capturing the amount of time it takes to
download a certain file from a web browser. I would like to be able to
run a script that would start when a download link is selected from the
browser, send the requested file to the client, then time this
transaction.
I am having a hard time getting started with this, as I am not sure
where to begin.
I've looked at CGI::Push, but couldn't get that to work properly. I've
also tried using "Content-type: multipart/x-mixed-replace", but no luck.
Am I heading in the right direction?
Are any specific modules that handle this type of interaction?
Any help is appreciated?
Thank You,
Justis
------------------------------
Date: Wed, 31 Mar 1999 14:07:10 -0600
From: "Jim Johnson" <nospam@here.com>
Subject: Re: Use of Require in Win32
Message-Id: <7dtv9f$95i@mars.dsu.edu>
You probably just need to reuturn a one from the file. Here a small
subroutine that I re-use, notice the "1;" at the end of the file. Maybe if
anything is wrong/bad with my script, a guru could correct me?
#CheckGroups.pl Created 7Jan1999 by Jim Johnson, nospam@here.com
#
#Checks to see if the array of groups passed in are valid
# global groups in the domain.
#
#Note: Made in PFE with tabs set to 2 spaces, so will probably look
# messed up in other editors.
#
#SYNOPSIS
#
#require "\\\\SHARE\\Perl Scripts\\Lib\\CheckGroups.pl";
#CheckGroups("Domain", "Group1", "Group2", ...);
#
#
#**************************************************************
sub CheckGroups
{
use Win32::NetAdmin;
my ($Domain, @Groups) = @_;
my ($Comment); #Needed for GroupGetAttributes
my ($DomainController);
#Get the name of the domain controller
Win32::NetAdmin::GetDomainController('', $Domain, $DomainController);
foreach (@Groups)
{
#If you can't get a comment for this group, then it doesn't exist.
unless (Win32::NetAdmin::GroupGetAttributes($DomainController, $_,
$Comment))
{
print "\nGlobal group \"$_\" does not exist on domain \"$Domain\"!\n";
print "You must create this group in User Manager for Domains.\n";
return 0; #Return failure
}
}
#Return success
return 1;
}
#**************************************************************
1; #Need this to return true!!
<karasp@my-dejanews.com> wrote in message
news:7dtjl1$310$1@nnrp1.dejanews.com...
> I am trying to use the require statement to re-use sub routines in several
> scripts. I keep getting the error that the file to be included does not
return
> a true value. I am using perl version 5.005_02.
> Thanks
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 31 Mar 1999 22:18:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: which database to use in perl
Message-Id: <7du70e$jl0$2@client2.news.psi.net>
ashishkjain@my-dejanews.com (ashishkjain@my-dejanews.com) wrote on
MMXXXVIII September MCMXCIII in <URL:news:7dt5sq$m8t$1@nnrp1.dejanews.com>:
`` I want to use a simple but effective database of perl on my website, which
`` could handel upto 40,000 records and provide routines for searching, inserting
`` ,deleting ,frequent appending of the records say 1 record per second.
1 record per second is a pretty lousy performance. Almost any database
should get that. Unless of course you would create an insane amount of
indices and triggers.
Abigail
--
perl -wlpe '}$_=$.;{' file # Count the number of lines.
------------------------------
Date: Wed, 31 Mar 1999 13:07:50 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Why won't this work?
Message-Id: <MPG.116c2e81db186caa989800@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <Pine.GSO.3.96.990331150914.10571A-100000@wired.your-
site.com> on Wed, 31 Mar 1999 15:12:44 -0500, Matthew Amster-Burton
<mamster@mamster.net> says...
...
> The usual way to do MSDOS-style paths is one of the following:
>
> 'c:\cgi\'
Well, maybe not that way exactly. Try it and see.
> "c:/cgi/"
>
> Forward slashes work fine.
And avoid that problem.
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 Mar 1999 16:52:25 -0500
From: Matthew Amster-Burton <mamster@mamster.net>
Subject: Re: Why won't this work?
Message-Id: <Pine.GSO.3.96.990331165014.19810A-100000@wired.your-site.com>
On Wed, 31 Mar 1999, Larry Rosler wrote:
> > 'c:\cgi\'
>
> Well, maybe not that way exactly. Try it and see.
Eep! Try before posting. Try before posting. There, I think I've got
it. (Or at least think before posting.)
Matthew
------------------------------
Date: Wed, 31 Mar 1999 17:17:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: www.pm.org
Message-Id: <comdog-ya02408000R3103991717380001@news.panix.com>
In article <37025217.7465BAA0@austin.ibm.com>, Tom Briles <tbriles@austin.ibm.com> posted:
> Not a perl (or Perl) question, but is this still supposed to be the Perl
> Monger page?
> Seems the page now goes to Smith Renaud (who was hosting, I believe?).
update your DNS. if you are seeing 166.84.185.27, then something is
wrong on your side.
before asking millions of people you won't know the answer, give me
a chance to respond. my email address is quite easy to find.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5271
**************************************