[19874] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2069 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 5 11:05:38 2001

Date: Mon, 5 Nov 2001 08: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: <1004976311-v10-i2069@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 5 Nov 2001     Volume: 10 Number: 2069

Today's topics:
        cannot access value of $hash{key}, but graphical debugg <thonibe@tronicplanet.de>
    Re: color problem in perl... <wyzelli@yahoo.com>
        Cookie killing by Perl <peter.cch@lycos.com>
    Re: Cookie killing by Perl <bart.lateur@skynet.be>
    Re: Failed scripts leave Perl behind <perl@omnibus-systems.net>
    Re: Failed scripts leave Perl behind (Tad McClellan)
    Re: Failed scripts leave Perl behind <tony_curtis32@yahoo.com>
        Need help: Looping mailer using too many resources (Marc Bissonnette)
    Re: Need help: Looping mailer using too many resources (Mark Jason Dominus)
    Re: Need help: Looping mailer using too many resources (Marc Bissonnette)
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: Newbie help please with free perl form scripts <robin1@otenet.gr>
    Re: Newbie help please with free perl form scripts (Tad McClellan)
    Re: One for the Perl Wizards... (Tad McClellan)
    Re: Path question <s1sims@inet.att.co.kr>
    Re: Perl Module problem <comdog@panix.com>
    Re: Processing portions of an array (Mark Jason Dominus)
    Re: reading and writing with perl CGI to client machine <nobody@nowhere.com>
    Re: Serial Port control under Win32::SerialPort (David)
        Sorting an array - help please <plain@englishtec.freeserve.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 05 Nov 2001 13:47:44 +0100
From: Bernhard <thonibe@tronicplanet.de>
Subject: cannot access value of $hash{key}, but graphical debugger says it is  there...
Message-Id: <3BE68A70.60AB1F41@tronicplanet.de>

Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------6A207E8AEDAEEB94F4F1038E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

hi all,
my code looks something like that:

1:  my %testhash(test1 => 1, test2 => 2,);
2:  my $test;
3:  $test = $testhash{'test2'};

5:  foreach $el_atarray (@atarray)

7:    {

9:  	SWITCH:
		{
11: 		  ...want to use $test here...
  		}
  }

i am really confused now, because i cannot see, why this does not work;
for debugging i use the graphical debugger from www.schweizr.com (and
also commandline debugging);
$testhash{'test2'} tells me that there is stored the value 1, but $test
says me: undef, but why;
thanx for any hints;
greeting,
bernie
--------------6A207E8AEDAEEB94F4F1038E
Content-Type: text/x-vcard; charset=us-ascii;
 name="thonibe.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Karte für Bernhard 
Content-Disposition: attachment;
 filename="thonibe.vcf"

begin:vcard 
n:Thoni;Bernhard
tel;fax:+49 8571 921351
tel;work:+49 8571 921350
x-mozilla-html:FALSE
url:http://www.tronicplanet.de
org:Tronicplanet Datendienst GmbH;Service / Support
adr;quoted-printable:;;Muenchner Strasse 16=0D=0A;Simbach / Inn;Bayern;84359;D
adr:;;Muenchner Strasse 16	;Simbach / Inn;Bayern;84359;Deutschland
version:2.1
email;internet:bernhard.thoni@tronicplanet.de
x-mozilla-cpt:;7264
fn:Bernhard Thoni
end:vcard

--------------6A207E8AEDAEEB94F4F1038E--



------------------------------

Date: Mon, 5 Nov 2001 23:01:45 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: color problem in perl...
Message-Id: <O4wF7.14$7%5.810@wa.nnrp.telstra.net>

"fail006" <fail006@hotmail.com> wrote in message
news:9s5pfh$vuc$1@lust.ihug.co.nz...
> Hi,
> I am trying to print colored text in perl, on win98 platform. Here the
> script that in copied of the web and tried ruuning it to see if it works
>
>  use Term::ANSIColor;
>     print color 'bold blue';
>     print "This text is bold blue.\n";
>     print color 'reset';
>     print "This text is normal.\n";
>     print colored ("Yellow on magenta.\n", 'yellow on_magenta');
>     print "This text is normal.\n";
>     print colored ['yellow on_magenta'], "Yellow on magenta.\n";
>
> here is the output from the msdos window...this is not right..what else do
i
> need to do..
>
> This text is bold blue.
> This text is normal.
> Yellow on magenta.
> This text is normal.
> Yellow on magenta.
> 
>
> How do i print color????

Have you loaded ansi.sys in your config.sys?

Wyzelli
--
#Modified from the original by Jim Menard
for(reverse(1..100)){$s=($_==1)? '':'s';print"$_ bottle$s of beer on the
wall,\n";
print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
$_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
wall\n\n";}print'*burp*';




------------------------------

Date: Mon, 5 Nov 2001 19:59:46 +0800
From: "Peter CCH" <peter.cch@lycos.com>
Subject: Cookie killing by Perl
Message-Id: <3be67f77$1_1@news.tm.net.my>

I alreaddy create a script to write a cookie, below is part of the code.
#---------------------------------------------------------------------------
--------------------------------------
print "Set-Cookie: name=Site_Login, userid=peter, password=PEwWHyUJYSAl.,
authority=abcdefghij\n";
#---------------------------------------------------------------------------
--------------------------------------


Then I print it out by this code:
#---------------------------------------------------------------------------
--------------------------------------
print "Content-type: text/html\n\n";

print "Below is the test cookie.\n";
print "$ENV{HTTP_COOKIE}\n";
#---------------------------------------------------------------------------
--------------------------------------

After printing it, I can see the stuff that i write:
"name=Site_Login, userid=peter, password=PEwWHyUJYSAl.,
authority=abcdefghij;"

But after that i create another script with the syntax below to kill it, it
seem like didn't work. Why ?

#---------------------------------------------------------------------------
--------------------------------------
$before = time - 1080000;
$date = gmtime($before);

print "Set-Cookie: Expires=$date\n";
#---------------------------------------------------------------------------
--------------------------------------

I still can see the cookie information when I print it with the second
example code above.
Then i refresh it for a few time, it still the same. I still can see the
information in the cookie.
Where is the the mistake ?

This is what I can see after refresh it a few time:
"name=Site_Login, userid=peter, password=PEwWHyUJYSAl.,
authority=abcdefghij; Expires=Tue Oct 23 23:49:57 2001;
p_go2id=9ogwQOs4YSn-Zy_LD5k2mC; Visits=1 "



Thanks for telling me my mistake.



Regarrds,
Peter




------------------------------

Date: Mon, 05 Nov 2001 13:44:04 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Cookie killing by Perl
Message-Id: <jp5duto760v5c9nio0upq070nrq844knc7@4ax.com>

Peter CCH wrote:

>But after that i create another script with the syntax below to kill it, it
>seem like didn't work. Why ?
>
>#---------------------------------------------------------------------------
>--------------------------------------
>$before = time - 1080000;
>$date = gmtime($before);
>
>print "Set-Cookie: Expires=$date\n";

Your date syntax isn't quite right. You should be playing with
CGI::Cookie.

But anyway: you didn't provide a name for the cookie. Therefore the
browser will ignore it. The syntax should be almost identical as that
for setting the cookie, with an expiry date in the past.

-- 
	Bart.


------------------------------

Date: Mon, 05 Nov 2001 09:15:22 -0500
From: Ken <perl@omnibus-systems.net>
Subject: Re: Failed scripts leave Perl behind
Message-Id: <mi7duto80oh195845bg6l5d3j014o24eq9@4ax.com>

Thanks for the test. I am curious how apache knows you have left the
page? Could I impose on you to try an endless loop that does not do
I/O? 

Ken

On 05 Nov 2001 05:08:28 GMT, snart@nospam.com (Ralph Snart) wrote:

>On Sun, 04 Nov 2001 22:34:51 -0500, Ken <perl@omnibus-systems.net> wrote:
>>Thanks for your thoughts. Although I have this urge to drop Perl and
>>go to PHP, Python, or even VBScript I suspect all of these languages
>>may suffer the same fate. Any script is activated when its URL is
>>touched. But that touch lasts only a momnet. Its just not possible to
>>tell when a user has lost interest.
>
>apache kills the perl script when you leave the page in your browser.
>
>at least, it does for me.
>
>just tested with apache 1.3.22, perl 5.6.1, on freebsd 4.  visited
>using internet explorer from win2k.
>
>
>here is my test script:
>
>#!/usr/bin/perl
>
>print "Content-type: text/plain\n\n";
>print "foo\n" while 1;
>
>-rs-



------------------------------

Date: Mon, 05 Nov 2001 14:18:09 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Failed scripts leave Perl behind
Message-Id: <slrn9ud4bo.5r3.tadmc@tadmc26.august.net>

Ken <perl@omnibus-systems.net> wrote:

>in a forever loop (must send this to Larry Wall, if you have
>for, foreach, then why not forever).


We already have a forever loop:

   while ( 'forever' ) {
      # infinite loop
   }


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 05 Nov 2001 08:21:44 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Failed scripts leave Perl behind
Message-Id: <87668ps3gn.fsf@limey.hpcc.uh.edu>

>> On Mon, 05 Nov 2001 14:18:09 GMT,
>> tadmc@augustmail.com (Tad McClellan) said:

> Ken <perl@omnibus-systems.net> wrote:
>> in a forever loop (must send this to Larry Wall, if you
>> have for, foreach, then why not forever).

> We already have a forever loop:
>    while ( 'forever' ) { # infinite loop }

Or even

for (;'ever';) {
  # blah
}

-- 
Oh!  I've said too much.  Smithers, use the amnesia ray.


------------------------------

Date: Mon, 05 Nov 2001 15:22:53 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Need help: Looping mailer using too many resources
Message-Id: <Xns91506A65BBCA7dragnetinternalysisc@207.35.177.135>

Hi All;

I need some help: I have a mass-mailer that is used for a client's mailing 
list (It is *not* for spam!), but it keeps crashing with a 500 server error 
after about 100 mailings. There are no entries in the error log, and I 
can't see anything funky in /var/mesages. I emailed my ISP's support and 
they say it is probably using up all the allocated memory for our virtual 
server. It is reading names and emails in from a text file in the format of 
fname    	lname    	email

open (WSENT,">>$sentlog");
open (RMAIL, $validfile)|| &CgiError ("Cannot find maillist! $!");
$today=&GetDate;
while (<RMAIL>) {
	chomp;
	@line=split (/\t/,$_);
	$name=$line[0];
	$lname=$line[1];
	$email=$line[2];
	$email=~ tr/A-Z/a-z/;

	open(MAIL,"|$mailprog") || &CgiError ("Problem with sendmail: $!");

	print MAIL "To: $email ($name $lname)\n";
	print MAIL "From: $in{'fromemail'} ($in{'fromname'})\n";
	print MAIL "Subject: $in{subject}\n";
	print MAIL "\n\n";
	print MAIL "$in{greeting} $name\n\n$in{message}\n\n$in{signoff}\n\n";
	print MAIL "You have received this message because you asked 
(CUSTOMER) to notify you of special offers and promotions at 
http://www.CUSTOMER.com/cgi-local/mailme.cgi\n\nIf you wish to be removed, 
please email XXXXX\@XXXXX.XXX and we will remove you from our notification 
list.\n";
	print "$today successful send to $name $lname ($email)<BR>\n";
	print WSENT "$today successful send to $name $lname ($email)\n";
	close (MAIL);
}

I am using cgi-lib.pl for a couple of routines and the message and the 
from: name are being retrieved from a protected web page.

There are about 2000 valid addresses that this is supposed to send to. Can 
I flush the memory (or something to reduce resource use) after every loop? 
Is there something else in my code that I'm messing up on?

Help is greatly appreciated!

-- 
----------------------------

Marc Bissonnette
InternAlysis
Intelligence in Internet Communications
http://www.internalysis.com


------------------------------

Date: Mon, 05 Nov 2001 15:50:39 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Need help: Looping mailer using too many resources
Message-Id: <3be6b54e.616f$1bb@news.op.net>

In article <Xns91506A65BBCA7dragnetinternalysisc@207.35.177.135>,
Marc Bissonnette <dragnet@internalysis.com> wrote:
>I need some help: I have a mass-mailer that is used for a client's mailing 
>list (It is *not* for spam!), but it keeps crashing with a 500 server error 
>after about 100 mailings. There are no entries in the error log, and I 
>can't see anything funky in /var/mesages. I emailed my ISP's support and 
>they say it is probably using up all the allocated memory for our virtual 
>server. 

That seems plausible.

>There are about 2000 valid addresses that this is supposed to send to. Can 
>I flush the memory (or something to reduce resource use) after every loop? 
>Is there something else in my code that I'm messing up on?

You're trying to run 2000 copies of the mailer at the same time.  It
is not too surprising that the machine is crashing.

I suggest that you put code into the loop to moderate the number of
messages you send at once.  You might try having your program sleep
for a few seconds after every ten or twenty messages.

>while (<RMAIL>) {
>       ...
>	close (MAIL);
        if (++$num_sent % 10 == 0) {
          sleep 3;
        }
>}

This may still be too fast, depending on the capabilities of the
computer.  Or it may be slower than necessary.  (It will send the 2000
messages over about 10 minutes.)

You might also try reading the manual for your mailer to see if it has
any option that is suggestive.  For example, there might be an option
that says "put this message in the queue, but do not try to deliver it
immediately."  Then the mailer process can exit more quickly and let
the queued mail be delivered later.  I would have tried to offer more
specific advice, but your post did not say what the mailer program was.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


------------------------------

Date: Mon, 05 Nov 2001 16:01:24 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Re: Need help: Looping mailer using too many resources
Message-Id: <Xns9150701616A09dragnetinternalysisc@206.172.150.13>

mjd@plover.com (Mark Jason Dominus) wrote in
news:3be6b54e.616f$1bb@news.op.net: 

> You might also try reading the manual for your mailer to see if it has
> any option that is suggestive.  For example, there might be an option
> that says "put this message in the queue, but do not try to deliver it
> immediately."  Then the mailer process can exit more quickly and let
> the queued mail be delivered later.  I would have tried to offer more
> specific advice, but your post did not say what the mailer program was.

Sorry, should have thought of that: It's sendmail on a FreeBSD system 
(Verio is the web host)
-- 
----------------------------

Marc Bissonnette
InternAlysis
Intelligence in Internet Communications
http://www.internalysis.com


------------------------------

Date: Mon, 05 Nov 2001 14:43:25 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tud9cd9frkh77f@corp.supernews.com>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 29 Oct 2001 14:51:35 GMT and ending at
06 Nov 2001 01:56:49 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2001 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Totals
======

Posters:  118 (38.8% of all posters)
Articles: 194 (22.7% of all articles)
Volume generated: 341.2 kb (20.8% of total volume)
    - headers:    152.7 kb (3,135 lines)
    - bodies:     181.2 kb (5,911 lines)
    - original:   117.5 kb (4,030 lines)
    - signatures: 7.1 kb (117 lines)

Original Content Rating: 0.649

Averages
========

Posts per poster: 1.6
    median: 1.0 post
    mode:   1 post - 83 posters
    s:      1.8 posts
Message size: 1800.8 bytes
    - header:     805.9 bytes (16.2 lines)
    - body:       956.5 bytes (30.5 lines)
    - original:   620.4 bytes (20.8 lines)
    - signature:  37.4 bytes (0.6 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   15    29.3 ( 12.8/ 12.9/  4.9)  Uri Guttman <uri@stemsystems.com>
    7    13.2 (  5.4/  7.8/  1.1)  Nick Temple <nicktemple2000@yahoo.com>
    6    11.9 (  5.7/  6.3/  2.3)  "spamfree" <spamfree@go-away.net>
    5    10.3 (  3.7/  5.5/  3.4)  Graham Drabble <graham.drabble@lineone.net>
    5     7.3 (  4.0/  3.3/  2.2)  Ken <perl@omnibus-systems.net>
    4     8.0 (  3.8/  3.1/  2.1)  Ilmari Karonen <usenet11627@itz.pp.sci.fi>
    4     6.8 (  3.3/  3.5/  2.4)  WODEN <w_oden@hotmail.com>
    3     5.0 (  2.3/  2.6/  1.8)  Terry <tdupuis@omafra.gov.on.ca>
    3     4.5 (  2.5/  1.9/  0.6)  "Emping Melindjo" <emelindjo@hotmail.com>
    3     5.2 (  3.4/  1.8/  1.5)  Paul Johnson <aeropaul@sbcglobal.net>

These posters accounted for 6.4% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  29.3 ( 12.8/ 12.9/  4.9)     15  Uri Guttman <uri@stemsystems.com>
  15.9 (  2.2/ 13.7/  5.7)      3  "Dynamo" <robin1@otenet.gr>
  13.2 (  5.4/  7.8/  1.1)      7  Nick Temple <nicktemple2000@yahoo.com>
  11.9 (  5.7/  6.3/  2.3)      6  "spamfree" <spamfree@go-away.net>
  10.3 (  3.7/  5.5/  3.4)      5  Graham Drabble <graham.drabble@lineone.net>
   9.2 (  2.8/  6.5/  2.2)      3  "Aaron Dancygier" <nospam_kingony@yahoo.com>
   8.0 (  3.8/  3.1/  2.1)      4  Ilmari Karonen <usenet11627@itz.pp.sci.fi>
   7.3 (  4.0/  3.3/  2.2)      5  Ken <perl@omnibus-systems.net>
   6.8 (  2.4/  4.4/  4.4)      3  "Mark Bright" <markbright@optusnet.com.au>
   6.8 (  3.3/  3.5/  2.4)      4  WODEN <w_oden@hotmail.com>

These posters accounted for 7.2% of the total volume.

Top 10 Posters by OCR (minimum of three posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.999  (  4.4 /  4.4)      3  "Mark Bright" <markbright@optusnet.com.au>
0.983  (  0.3 /  0.3)      3  "xin" <shenxin@sympatico.ca>
0.813  (  1.5 /  1.8)      3  Paul Johnson <aeropaul@sbcglobal.net>
0.694  (  1.8 /  2.6)      3  Terry <tdupuis@omafra.gov.on.ca>
0.685  (  2.4 /  3.5)      4  WODEN <w_oden@hotmail.com>
0.681  (  2.2 /  3.3)      5  Ken <perl@omnibus-systems.net>
0.669  (  2.1 /  3.1)      4  Ilmari Karonen <usenet11627@itz.pp.sci.fi>
0.604  (  3.4 /  5.5)      5  Graham Drabble <graham.drabble@lineone.net>
0.464  (  0.9 /  2.0)      3  "Matt" <pneumatus@NOSPAMhotmail.com>
0.418  (  5.7 / 13.7)      3  "Dynamo" <robin1@otenet.gr>

Bottom 10 Posters by OCR (minimum of three posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.669  (  2.1 /  3.1)      4  Ilmari Karonen <usenet11627@itz.pp.sci.fi>
0.604  (  3.4 /  5.5)      5  Graham Drabble <graham.drabble@lineone.net>
0.464  (  0.9 /  2.0)      3  "Matt" <pneumatus@NOSPAMhotmail.com>
0.418  (  5.7 / 13.7)      3  "Dynamo" <robin1@otenet.gr>
0.410  (  0.9 /  2.2)      3  TD <tushar08@yahoo.com>
0.378  (  4.9 / 12.9)     15  Uri Guttman <uri@stemsystems.com>
0.373  (  2.3 /  6.3)      6  "spamfree" <spamfree@go-away.net>
0.346  (  2.2 /  6.5)      3  "Aaron Dancygier" <nospam_kingony@yahoo.com>
0.311  (  0.6 /  1.9)      3  "Emping Melindjo" <emelindjo@hotmail.com>
0.144  (  1.1 /  7.8)      7  Nick Temple <nicktemple2000@yahoo.com>

16 posters (13%) had at least three posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      19  comp.lang.perl.modules
      14  comp.lang.perl
      11  alt.perl
       9  comp.databases.ms-sqlserver
       9  microsoft.public.sqlserver.connect
       6  comp.lang.perl.tk
       5  alt.os.windows2000
       3  comp.lan.perl.moderated
       2  comp.perl.lang.modules
       1  comp.lang.tcl

Top 10 Crossposters
===================

Articles  Address
--------  -------

       4  Walter Usyk <usyk@home.com>
       2  "Joseph J. Whalen" <joe.whalen@broadbeam.com>
       2  OSx <femello@mac.com>
       2  "Christian Winter" <thepoet@nexgo.de>
       2  "Benn Wolff" <Benn_Wolff@HOTMAIL.COM>
       2  Al Binns <al_binns@yahoo.com>
       2  "Aaron Dancygier" <nospam_kingony@yahoo.com>
       2  =?iso-8859-1?Q?Daniel_Schr=F6er?= <ketamama@gmx.net>
       2  Mark Goodge <mark@good-stuff.co.uk>
       2  "oj" <nospam_ojngo@home.com>


------------------------------

Date: Mon, 5 Nov 2001 15:11:34 -0800
From: "Dynamo" <robin1@otenet.gr>
Subject: Re: Newbie help please with free perl form scripts
Message-Id: <9s63fc05ki@enews2.newsguy.com>

Tim,

Thanks for that. Still trying to get to grips with all the info but slowly
digesting it. I don't know how old you are but I am 45 and just venturing
into all this space age stuff and the brain takes a little longer to
function.

You were right. Fasthosts sublet to net2. If I want the additional features
of fasthosts (FPE , activesate perl etc) I have to pay another $200!! YUK!!

So I searched the net and found another version of Matt Wrights formmail.pl
which supposedly works with NT. I have to modify the $mailprog variable to
the path of the blat.exe file. Thats about as much as the readme file tells
me. I assume they mean the path to the blat.exe file on my hosts server?

I will let you know how I get on. I am posting this message because other
users of NT hosts might find the info useful.

Kind regards
Paul Robinson

Tim Hammerquist <tim@vegeta.ath.cx> wrote in message
news:slrn9u92hq.3sn.tim@vegeta.ath.cx...
> [ posted and mailed...by accident =]
>
> Dynamo wrote:
> > Sorry but its been a long day. Should have known better than to post in
NG
> > using HTML (first apology) and you were correct in that I could have
found
> > out faster about FastHosts and blat using search engines without wasting
the
> > groups time (second apology). However, what threw me was that my
webserver
> > (net2.co.uk) who host my site were informing me about fasthost. I
mistakenly
> > assumed therefore that fasthost was some technology that I needed to get
my
> > form to work rather than being another webserver!! Are net2 saying to me
> > that they don't want my business?
>
> Actually, I got the same picture.  Is it possible that fasthosts sublets
> its bandwidth to net2?  I know out here in the states that there's an
> hierarchy of at least 3 companies just in Reno. (eg, Great Basin sublets
> to Pyramid, Pyramid sublets to Nanosecond, Nanosecond sublets to other
> clients, etc.) And usually any T1 or T3 in the western United States can
> be traced back to a UC Berkley T3.
>
> > All the same thanks for your response but just one last query. Being a
total
> > newbie (el thicko) what do I do with the C:\> perldoc -q "send mail"
that
> > you mention and how will it help me?
>
> Well, if you're going to be developing perl scripts (or even just
> installing them), you should have a copy of the documentation, which
> comes with every perl distribution. ActivePerl, notably, comes with a
> heavily cross-linked HTML version of the perl docs.  A searchable,
> command-line interface to the perldocs is perldoc (PERLDOC.BAT on
> Win32).  The -q tells perldoc to search the questions in the FAQs for
> the string following ("send mail").  Running the following on my Win32
> box:
>
> C:\ > perldoc -q "send mail"
>
> ...would yield the following:
>
> Found in /usr/lib/perl5/5.6.0/pod/perlfaq9.pod
>   How do I send mail?
>
>             Use the `sendmail' program directly:
> [ snip ]
>             Alternate, less convenient approaches include calling mail
>             (sometimes called mailx) directly or simply opening up port 25
>             have having an intimate conversation between just you and the
>             remote SMTP daemon, probably sendmail.
>
>             Or you might be able use the CPAN module Mail::Mailer:
>
>                 use Mail::Mailer;
>
>                 $mailer =3D Mail::Mailer->new();
>                 $mailer->open({ From    =3D> $from_address,
>                                 To      =3D> $to_address,
>                                 Subject =3D> $subject,
>                               })
>                     or die "Can't open: $!\n";
>                 print $mailer $body;
>                 $mailer->close();
>
>             The Mail::Internet module uses Net::SMTP which is less
>             Unix-centric than Mail::Mailer, but less reliable. Avoid raw
>             SMTP commands. There are many reasons to use a mail transport
>             agent like sendmail. These include queueing, MX records, and
>             security.
>
> This admits to being unix-centric, but includes some more generic
> solutions.  It also seems to hint at using blat or CDONTS, since they
> are WinNT Mail Transport Agents (MTAs); they would have to be changed,
> however, if you moved to a *nix server.
>
> Does that help?
>
> > Kind Regards
> > Paul Robinson
>
> Tim
> --
> It's not the inital skirt length, it's the upcreep.




------------------------------

Date: Mon, 05 Nov 2001 14:42:15 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie help please with free perl form scripts
Message-Id: <slrn9ud5ku.5u8.tadmc@tadmc26.august.net>

Dynamo <robin1@otenet.gr> wrote:
>
>Thanks for that. Still trying to get to grips with all the info but slowly
>digesting it. I don't know how old you are but I am 45 and just venturing
>into all this space age stuff and the brain takes a little longer to
>function.

>So I searched the net and found another version of Matt Wrights formmail.pl
                                                    ^^^^^^^^^^^^
                                                    ^^^^^^^^^^^^

You will learn The Wrong Way to Program if you use Matt's code.

They are extremely bad examples of Perl programming.

Most have security holes in them too...


[snip Jeopardy quoted text]

-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 05 Nov 2001 14:18:10 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: One for the Perl Wizards...
Message-Id: <slrn9ud4t6.5r3.tadmc@tadmc26.august.net>

mario <mgaffi@acxiom.com> wrote:
>In the following piece of code, any idea why the index() call, which
>is outside the while loop, slows down the while loop?


Can't help with that, but your code has some other cruft that
I'll comment on.


>use constant VERBOSE => scalar 500000;
>open(DATA, "Version1-1/IB.dat");


You should always, yes *always*, check the return value from open():

   open(DATA, 'Version1-1/IB.dat') or 
      die "could not open 'Version1-1/IB.dat' $!";


>$tm = `date`; chomp($tm); print STDERR "[$tm] $. records.\n";


Why shell out for something easily done with native Perl?

   my $tm = localtime;


>$s = index($tm, 0, 3);


A string should *look like* a string:

   $s = index($tm, '0', 3);

You should probably be checking the return value here too.

Maybe you meant to use substr() instead of index() ?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 05 Nov 2001 19:56:49 -0600
From: Money Man <s1sims@inet.att.co.kr>
Subject: Re: Path question
Message-Id: <3BE74360.A2C6E226@inet.att.co.kr>

Hey, I screwed up the path that Perl looks for
it's configuration files with an update from CPAN.
It created the directory /usr/lib/perl5/site_perl/
which isn't complete, so when I try and run perl
scrips, perldoc, etc. I get errors. Where do I
reset the configuration path for Perl?

Thanks,

Steve



------------------------------

Date: Mon, 05 Nov 2001 07:44:24 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Perl Module problem
Message-Id: <comdog-014FDF.07442405112001@news.panix.com>

In article <9s5qfk$qs0$1@wanadoo.fr>, "Anthony Heuveline" 
<Anthony.Heuveline@wanadoo.fr> wrote:

> I am working on a server where all Perl core modules are installed.

> I also need to use File::Basename and File::Copy modules but I didn't find
> them, even on CPAN.

they are in the core, so you already have them if you truly have all
of the core modules.

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



------------------------------

Date: Mon, 05 Nov 2001 15:54:19 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Processing portions of an array
Message-Id: <3be6b62a.619f$37a@news.op.net>

In article <3be1d716$1@post.usenet.com>,
htmailing <htmailing.nospam@yahoo.com> wrote:
>I cannot figure out how to break down the array and pass "mini-arrays" of 50
>to the sub.  Also, if @array contains 160 names, I want the script to pass
>the first 150 to the whatever() sub in 3 mini-arrays, and then the remaining
>10 should be also passed to whatever().


Try this:

        while (@array) {
          my @next_50 = splice @array, 0, 50;
          whatever(@next_50);
        }

Note that this destroys the contents of @array.  If you don't want
that, you can make a copy of @array first and destroy the copy
instead.


-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


------------------------------

Date: Mon, 5 Nov 2001 21:04:49 +1000
From: "Gregory Toomey" <nobody@nowhere.com>
Subject: Re: reading and writing with perl CGI to client machines? 
Message-Id: <couF7.82752$g8.69288@newsfeeds.bigpond.com>

G'Day
"hugo" <hugo@fractalgraphics.com.au> wrote in message
news:3BE646E7.8E0E626B@fractalgraphics.com.au...
> Hi
>
> I have a question about something that, for security reasons, possibly
> can't be done, and yet would be very useful to me.
>
> I want to read in a file with a cgi script, double space it, then write
> an output file back to the place the input file came from. Later on I
> want to perform more operations on the double-spaced file.
>
> If I have an input file on our server e.g. in /tmp/text.txt, I can read
> in the input file, and the output file is made, double spaced and all.
> No problem.
>
> However, (and I know this can normally not be done for sound security
> reasons) I would like a file to be uploaded from a client (e.g. a
> windows machine), and the output file being written away in the same
> directory of the client machine as well. So rather than getting my input
> file from /tmp/test.txt, I would like to get if from, for example,
> C:\mydirectory\test.txt and write the output file to that directory as
> well.
> Totally impossible?
You can use ftp if it is enabled on the client to send a file to the client.

>
> Note that when I try to upload from my local machine, the file is not
> found (as expected, as my C drive is not available to the server). So in
> short, my questions are:
>
> (1) How do I get the server to read in the file from the client
> directory and
ftp

(2) how do I allow the server to write an output file back
> to the same directory on the client machine.
ftp

gtoomey




------------------------------

Date: 5 Nov 2001 07:18:22 -0800
From: dgoldman@msn.com (David)
Subject: Re: Serial Port control under Win32::SerialPort
Message-Id: <c7681ff1.0111050718.65d00069@posting.google.com>

Thanks for the response. From what I understand the
$PortObj->rts_active(Yes) call only returns the status of the API
call, it does not set the state of the bit.

As for $ModemStatus = $PortObj->modemlines;
     if ($ModemStatus & $PortObj->MS_RLSD_ON) { print "carrier
detected"; }

I'm not sure what $PortObj->modemlines does - I'm not using a modem,
so I guess I need to understand that before I can use it. If I look at
what $PortObj->MS_RLSD_ON returns - it's always 128 which seems
incorrect as I don't always have the carrier signal high.

-- David

> > 1) Set RTS high/low
> 
> (set no handshaking when you open the port first)
> 
>   $PortObj->rts_active(Yes);            # return status of ioctl call
>                                         # return undef on failure
> 
> > 2) Detect CD high/low
> 
>   $ModemStatus = $PortObj->modemlines;
>   if ($ModemStatus & $PortObj->MS_RLSD_ON) { print "carrier detected"; }


------------------------------

Date: Mon, 05 Nov 2001 14:50:59 +0000
From: fred56 <plain@englishtec.freeserve.co.uk>
Subject: Sorting an array - help please
Message-Id: <hq9dutg6tgsvn69rqs7kihkf5dul66vqre@4ax.com>

Hi 

I'v been working my way through the book O'Reilly book Learning perl
and iv come up with a bit of code that allmost does what i want it to
(See bellow)

sub main {
	
	open(DATA, "< $file") or die "Can't open $file: $!";  #Open
Database
	while (<DATA>) {
		++$counter;
		@tabledata=split(/\s*\¶\s*/, $_);

($second_del,$third_del,$fourth_del,$fifth_del,$sixth_del,$eighth_del)
= @tabledata[1,2,3,4,5,7];
			if ($cf == $. .. $current_last == $.) {    
				$price = $third_del / 1.175;
				$price2 = sprintf("%.2f", $price);
	
			if ($Cookies{'cookiessi'} eq "no") {
				rechtmlnoimg();
			}
			else {
				rechtml();
			}
			}
		}
	close(DATA)

} #end sub main

what i want to be able to do is sort the array based on the third
field of the @tabledata  iv nearly finished  reading learning perl but
the book does not go into that much detail in regards to the sort
function or if it does i haven't read that part yet can any one show
me an example of how to achieve this and a short explanation as to why
it works.

PS i was going to read Programming Perl 3rd edd next unless ne one has
some other addvice of a better book to try next.

Thanks


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 2069
***************************************


home help back first fref pref prev next nref lref last post