[15700] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3113 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 21 18:05:35 2000

Date: Sun, 21 May 2000 15:05:11 -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: <958946711-v9-i3113@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 21 May 2000     Volume: 9 Number: 3113

Today's topics:
    Re: "Breakthrough" Perl compiler? <anthony@alphageo.com>
        ??? help! referrer url should be ...... swapnil909@my-deja.com
        DBI error (Blutemple31)
    Re: DBI error <bwalton@rochester.rr.com>
    Re: ENV{'REMOTE_HOST'} doesnt work, solution? <ppi@searchy.net>
    Re: ENV{'REMOTE_HOST'} doesnt work, solution? <tony_curtis32@yahoo.com>
        file handles - win32 <Luc-Etienne.Brachotte@wanadoo.fr>
    Re: file handles - win32 (Gwyn Judd)
        Form Script <mouimet@direct.ca>
    Re: Forum for 'how to do it' questions? <jeff@vpservices.com>
    Re: Forum for 'how to do it' questions? <ra.jones@NO_UCE*cwcom.net>
    Re: Forum for 'how to do it' questions? (Bart Lateur)
    Re: Global variables to apply to multiple Perl scripts <apietro@my-deja.com>
    Re: Global variables to apply to multiple Perl scripts <sweeheng@usa.net>
    Re: ISP for experimenting? <jeff@vpservices.com>
    Re: ISP for experimenting? <godzilla@stomp.stomp.tokyo>
    Re: ISP for experimenting? samurai@metallicafan.com
    Re: ISP for experimenting? <flavell@mail.cern.ch>
        loading a bunch of urls edelwater@my-deja.com
        PERL and CGI py1ll@my-deja.com
    Re: PERL and CGI <asound40NOasSPAM@hotmail.com.invalid>
        PERL and COM port py1ll@my-deja.com
    Re: perl to lunch "Save As" browser window ??? (Clinton A. Pierce)
    Re: perl to lunch "Save As" browser window ??? <flavell@mail.cern.ch>
    Re: perl to lunch "Save As" browser window ??? (Bart Lateur)
    Re: regexes *sigh* damn I hate these things <you.will.always.find.him.in.the.kitchen@parties>
    Re: regexes *sigh* damn I hate these things <sue@pennine.com>
        Suggest an approach for HTML Form submission <ecostello@home.com>
    Re: the use of $_ <you.will.always.find.him.in.the.kitchen@parties>
    Re: valid email address (Philip 'Yes, that's my address' Newton)
    Re: valid email address (Philip 'Yes, that's my address' Newton)
    Re: valid email address <tony_curtis32@yahoo.com>
    Re: valid email address <evilbeaver.picksoft@NOSPAMzext.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 21 May 2000 14:15:52 -0700
From: Anthony Argyriou <anthony@alphageo.com>
Subject: Re: "Breakthrough" Perl compiler?
Message-Id: <f4igisob8qpj45fq113rft0m79qk0cc6v1@4ax.com>

bart.lateur@skynet.be (Bart Lateur) wrote:

>I'm not making this up. I quote their website:
>
>http://www.activestate.com/ActivePerl/docs/faq/Windows/Install.html
>
>
>  Requirements
>
>  Windows 98
>
>     Microsoft Windows Installer 1.1+ (available from
>
>http://download.microsoft.com/download/platformsdk/wininst/1.1/W9X/EN-US/InstMsi.exe)
>
>     Internet Explorer 5 (available from
>     http://windowsupdate.microsoft.com) 
>     DCOM for Windows 98 (available from
>     http://www.microsoft.com/com/resources/downloads.asp) 

Funny, that. I installed Perl 5.6 from activestate on my work computer,
which has Win98 and IE 4 on it. No problems so far, but I don't use perl
that heavily at work.

Anthony Argyriou
http://www.alphageo.com/


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

Date: Sun, 21 May 2000 18:57:30 GMT
From: swapnil909@my-deja.com
Subject: ??? help! referrer url should be ......
Message-Id: <8g9bin$krk$1@nnrp1.deja.com>

- i have a website mysite.com
- i have some clients whom i give out an html snippet that they insert
in the webpages of myclients.com
	the html i give is like http://mysite.com/cgi-bin/something.pl
- on their webpages i show a banner
- i have a sponsor like valueclick.com whose banners i have to show to
earn money. the valueclick.com gives me some html that can show their
banners.
- now i have arranged it so that my clients are showing valueclick.com
banners on myclients.com
- fine.
- when somebody clicks on that banner, he goes to the right sponsor..
fine.
- the referrer the valueclick.com recieves is myclients.com

BUT I WANT THAT THE REFERRER THAT VALUECLIK.COM RECIEVES IS MYSITE.COM
AND NOT MYCLIENTS.COM

could somebody please help what should i do????
all programs are done in perl.
i have tried quite a few redirection scripts, but none seems to work.



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 21 May 2000 21:05:59 GMT
From: blutemple31@aol.com (Blutemple31)
Subject: DBI error
Message-Id: <20000521170559.00334.00000627@ng-da1.aol.com>

My script is generating the following error:

Software error:
Can't locate auto/DBI/selectrow_a.al in @INC (@INC contains:
/usr/lib/perl5/i386-linux/5.00404 /usr/lib/perl5
/usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) at admin.cgi
line 49 

Here is what I think is the relevant code with line numbers prepended.

46: while (my @row = DBI->fetchrow_array('select * from users')) {
47: print "@row\n";
48: }
49: print "</body></html>\n";
50: $dbh->disconnect;

Looks like there's some problem with the DBI module, but my web host says no.
Help!

Gabe


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

Date: Sun, 21 May 2000 21:28:44 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: DBI error
Message-Id: <39285547.521A3FAB@rochester.rr.com>

Blutemple31 wrote:
> 
> My script is generating the following error:
> 
> Software error:
> Can't locate auto/DBI/selectrow_a.al in @INC (@INC contains:
> /usr/lib/perl5/i386-linux/5.00404 /usr/lib/perl5
> /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) at admin.cgi
> line 49
> 
> Here is what I think is the relevant code with line numbers prepended.
> 
> 46: while (my @row = DBI->fetchrow_array('select * from users')) {

The above line is pretty bogus.  "fetchrow_array" is a method of a
statement handle object, not the DBI class.  The proper technique (as
shown repeatedly in examples in the docs) is:

$dbh=DBI->connect('whatever');
$sth=$dbh->prepare('select * from users');
$sth->execute;
while(@row=$sth->fetchrow_array){
	#do stuff with @row
}
$sth->finish;
$dbh->disconnect;

> 47: print "@row\n";
> 48: }
> 49: print "</body></html>\n";
> 50: $dbh->disconnect;
> 
> Looks like there's some problem with the DBI module, but my web host says no.

There might be, but this problem is with your code.

> Help!
> 
> Gabe


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

Date: Sun, 21 May 2000 20:27:33 +0200
From: Penpal International <ppi@searchy.net>
Subject: Re: ENV{'REMOTE_HOST'} doesnt work, solution?
Message-Id: <39282A95.621AC4D5@searchy.net>

Use this script:

$new_user_dns = $temp_ip = $ENV{'REMOTE_ADDR'};
$temp_ip =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/;
$address = pack('C4', $1, $2, $3, $4);
$user_dns = (gethostbyaddr($address, 2))[0];
if ($user_dns) { $new_user_dns = "lc $user_dns"; }

It gets the Hostname for the remote_addr From your ISP's nameserver.

"red [2]" wrote:
> 
> im making a log stats program, and i can get a whole bunch of information,
> but for some reason REMOTE_HOST doesnt work :/
> 
> i can gett he visitors ip with REMOTE_ADDR but HOST returns nothing..
> 
> i know its not the server the user is coming from, so is there an easy and
> quick way to reverse DNS the ip? or a reason why it might not work...
> 
> --
> 
> Graham "red" Reeves
> 
> uk's Q3 news & features - - www.quadmonkey.co.uk
> domains for sale - - http://www.quadmonkey.co.uk/files/forsale.html
> the stupid - - http://www.thestupid.com
> member of clan [2] - - http://www.clan2.com

-- 
Penpal International
http://ppi.searchy.net/
ppi@searchy.net


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

Date: 21 May 2000 13:41:45 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: ENV{'REMOTE_HOST'} doesnt work, solution?
Message-Id: <87snvboidy.fsf@limey.hpcc.uh.edu>

>> On Sun, 21 May 2000 20:27:33 +0200,
>> Penpal International <ppi@searchy.net> said:

[ please don't "jeopardise" posts, it makes it very
difficult to follow who is saying what to whom...put the
original text first citing only those bits you are
replying to, and then add your new text after the original
sections ]

> $new_user_dns = $temp_ip = $ENV{'REMOTE_ADDR'};
> $temp_ip =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/;
> $address = pack('C4', $1, $2, $3, $4);
> $user_dns = (gethostbyaddr($address, 2))[0];
> if ($user_dns) { $new_user_dns = "lc $user_dns"; }

Regexp is overkill, split() would be simpler here.  Also
lines 1, 2, and 3 contain unchecked lookups for various
values which might not exist, or for calls which might
fail.  '2' is a magic constant, I'm not sure that the
address family is represented by 2 on all systems.

There's also no need to "lc" the returned value, and the
quotes around "lc ..." don't do what you intended (it's a
literal in a string, thus the address ends up prefixed
with "lc ").

The use of "dns" is also misleading, since not all hosts
use DNS for lookups (e.g. the translation might be done
with NIS in some environments).

This isn't meant personally, it was a genuine attempt to
post code which would solve a problem, but always test
code before posting, and check potential failure areas,
such as gethostby* not returning what you expect (not all
addresses have a corresponding name for them).

I'd suggest using the Net::DNS module for this kind of
thing (given that generally DNS is implied here for WWW
applications where you're looking up addresses from
outside).  The documentation has various examples of its
use.

hth
t


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

Date: Sun, 21 May 2000 21:16:18 +0200
From: Luc-Etienne Brachotte <Luc-Etienne.Brachotte@wanadoo.fr>
Subject: file handles - win32
Message-Id: <39283602.AFE7688E@wanadoo.fr>

I have a complex Perl (on win32) script which modifies a lot of files.

The files are opened:
open filehandle, ">$File_name";

Then, on particular conditions, I would like to retrieve the file name
from the file handle:
$File_name=Get_file_name(filehandle)

it is not possible to use the former $File_name, the script would turn
to be very complicated.

Is it possible to write the the line of code which retrieves the file
name?

Thanks,

LEB




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

Date: Sun, 21 May 2000 21:46:02 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: file handles - win32
Message-Id: <slrn8ijaov.4gt.tjla@thislove.dyndns.org>

I was shocked! How could Luc-Etienne Brachotte <Luc-Etienne.Brachotte@wanadoo.fr>
say such a terrible thing:
>I have a complex Perl (on win32) script which modifies a lot of files.
>
>The files are opened:
>open filehandle, ">$File_name";
>
>Then, on particular conditions, I would like to retrieve the file name
>from the file handle:
>$File_name=Get_file_name(filehandle)
>
>it is not possible to use the former $File_name, the script would turn
>to be very complicated.
>
>Is it possible to write the the line of code which retrieves the file
>name?

hmm, well how about storing the filehandle and the name in a hash?
By the way you really should check for errors on open()'ing a file.
Something like this (untested) code should do it. Note I am no guru so
this may well be totally wrong.

open filehandle, ">$filename" or die "could not open $filename: $!";

$get_file_name{filehandle} = $filename;

and the later on when you wanted the name:

$filename = $get_file_name{filehandle};

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
The face of a child can say it all, especially the mouth part of the face.

		-- Unknown


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

Date: Sun, 21 May 2000 12:40:17 -0700
From: "Marcus Ouimet" <mouimet@direct.ca>
Subject: Form Script
Message-Id: <UVWV4.5536$58.252687@brie.direct.ca>

I am trying to find a perl script that will send the info for a form not
using sendmail. For some reason the script I am using gives no errors but
does the following:

Sends to:

something@something.com
something.something.com
something@something.ca
something@something.com.au

Will not send to:

something@sk.sympatico.ca
something@websurfer.co.za

    Does anyone wither know what the problem might be? I am pretty sure it
is a send mail problem, that is why I am looking for a script that I can
edit that doesn't use send mail..... Any suggestions/solutions?




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

Date: Sun, 21 May 2000 11:12:28 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Forum for 'how to do it' questions?
Message-Id: <3928270C.7AD9427C@vpservices.com>

jones wrote:
> 
> On Sun, 21 May 2000 at 14:57:47, Alan J. Flavell <flavell@mail.cern.ch>
> wrote:
> >
> > Can I say "WebTechniques" for one example? 
> >
> What do you mean
> 'WebTechniques'? Is this a specific document or web-site, or are you
> suggesting I do a general Internet search on this keyword?

Internet keyword searches are never amiss, google gives me the correct
place as the first hit on this one.  But what Alan meant was the regular
Perl column written by Randal Schwartz in the magazine "Web
Techniques".  These absolutley invaluable columns are also collected at 

	http://www.stonehenge.com/merlyn/WebTechniques/

> > And in your own interest, _do_ desist from upside-down-quoting.

> That seems to be a matter of opinion.

Perhaps, but the opinion of this newsgroup is as Alan said.  Look back
through the archives (at www.deja-news.com) under the keyword Jeopardy
and you will see hundreds of requests by the regulars of this newsgroup
for posters to post with the context first and their replies
afterwards.  I don't believe there is anyone here who will reject a
first time posting solely on quoting style (though it does send out a
red flag), but I do believe there are a good many who will simply stop
reading postings by authors who continue to post out of context after
being asked not to.

> some who are of the opinion that quoting should not be at the 
> top because they have already read it once

That doesn't work in a newsgroup where there are up to 400 postings a
day.  With that quantity, it is vital to preserve context if we want to
have any semblance of a conversation.

-- 
Jeff


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

Date: Sun, 21 May 2000 20:22:10 +0100
From: jones <ra.jones@NO_UCE*cwcom.net>
Subject: Re: Forum for 'how to do it' questions?
Message-Id: <pkPLNWAidDK5EwbO@cwc.com>

On Sun, 21 May 2000 at 11:12:28, Jeff Zucker <jeff@vpservices.com> 
wrote:
>Internet keyword searches are never amiss, google gives me the correct
>place as the first hit on this one.  But what Alan meant was the regular
>Perl column written by Randal Schwartz in the magazine "Web
>Techniques".  These absolutley invaluable columns are also collected at
>
>       http://www.stonehenge.com/merlyn/WebTechniques/
Thanks for that - another useful resource bookmarked. Actually, I have 
that book (Learning Perl), but as yet it is too advanced.

>> > And in your own interest, _do_ desist from upside-down-quoting.
>
>> That seems to be a matter of opinion.
>Perhaps, but the opinion of this newsgroup is as Alan said.  Look back
>through the archives (at www.deja-news.com) under the keyword
But as I went on to say - I have no problem with retaining the quote 
above the reply. It certainly makes the reply easier to understand. We 
have no dispute here.
-- 
Richard Jones, Leeds, UK
rajones (at) mail.com
or remove NO_UCE* from 'reply-to' address


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

Date: Sun, 21 May 2000 21:35:00 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Forum for 'how to do it' questions?
Message-Id: <39284c64.519810@news.skynet.be>

jones wrote:

>What do you mean 
>'WebTechniques'? Is this a specific document or web-site, or are you 
>suggesting I do a general Internet search on this keyword?

It's a magazine. <www.webtechniques.com>. Most people here lnow it for
the Perl column by Randal Schwartz, which he also puts online at his own
site. Check it out, there are some real gems there.
<http://www.stonehenge.com/merlyn/WebTechniques/>

>>And in your own interest, _do_ desist from upside-down-quoting.
>That seems to be a matter of opinion. I don't have a preference, but I 
>have read some who are of the opinion that quoting should not be at the 
>top because they have already read it once, and it should be quoted 
>below, footnote style. But If quoting at the top is the norm for this 
>group - I'm happy with that.

And another thing: snip what you're replying to. I recently saw a post
with a lot of different opinions in, about lots aof stuff. Somebody
replied to it, quoting the whole damn post, and adding: "Right on!" at
the top. Now tell me, what was he agreeing with? The lot? I don't think
so.

-- 
	Bart.


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

Date: Sun, 21 May 2000 19:12:41 +0100
From: "A Pietro" <apietro@my-deja.com>
Subject: Re: Global variables to apply to multiple Perl scripts
Message-Id: <8g98v0$bcq$1@sshuraac-i-1.production.compuserve.com>

Thanks, that sounds like just what I need.

I'll have to read it through and think about it, though -- I have never
written a perl module before, I though they were for expert programmers!

Do I put this stuff:

>>=== begin YourModule/Config.pm ===
package YourModule::Config;
use strict;
use vars qw(@ISA @EXPORT %Conf);
use Exporter;
@ISA    = qw(Exporter);
@EXPORT = qw(%Conf); # make %Conf globally accessible
%Conf = (
    INSTALL_DIR => '/home/development/test',
    DEBUG       => 0,
    OTHER_PARAM => '/bah/bah/black/sheep',
);
1; # remember to end with a TRUE value!
==== end YourModule/Config.pm ====
<<

In a file called Config.pm ? in YourModule/ directory?

Then call it with:

use YourModule::Config

in my script?

I'll try it out -- this looks like a major leap forward for me!

Thanks
AP





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

Date: Mon, 22 May 2000 02:40:03 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: Global variables to apply to multiple Perl scripts
Message-Id: <8g9a7u$cos$1@mawar.singnet.com.sg>

> I'll have to read it through and think about it, though -- I have never
> written a perl module before, I though they were for expert programmers!
now is the time to try! and no - i am no expert.

> Do I put this stuff:
> >>=== begin YourModule/Config.pm ===
> package YourModule::Config;
> ...
> 1; # remember to end with a TRUE value!
> ==== end YourModule/Config.pm ====
> In a file called Config.pm ? in YourModule/ directory?
Yup. Something like that. See the libnet modules. Learn from THE experts.

> Then call it with:
> use YourModule::Config
> in my script?
Yes.

> I'll try it out -- this looks like a major leap forward for me!
Congrats!






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

Date: Sun, 21 May 2000 11:17:14 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: ISP for experimenting?
Message-Id: <3928282A.869310D7@vpservices.com>

Bob Margulies wrote:
> 
> Is there a way for me find an ISP that would allow me to experiment with
> Perl scripting?

That's been discussed here many times. I'd tell you the answer if I
remembered it.  But you can find out yourself by looking through the
archives at www.deja-news.com with the keywords "cgi" "scripting"
"ISP".  It is also quite easy to install perl and free web server
software on your home computer and test almost everything locally before
sending it to the ISP.  More information on that kind of local testing
is available in the documentation that comes with Perl
(start-menu/programs/activeperl/online-documentation).

-- 
Jeff


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

Date: Sun, 21 May 2000 11:42:04 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: ISP for experimenting?
Message-Id: <39282DFC.DC5BBAF8@stomp.stomp.tokyo>

Bob Margulies wrote:
 
> I am interested in doing some server-side Perl programming. This would
> require me to install a script in my directory on my ISP's site, which I
> would then run from my Windows 98 computer. When I asked my ISP how I
> might go about this, I was told to submit the script to them, and after
> they inspected and approved it, they would install it for me.
 
> Since I am only a beginner at this kind of programming, I expect it
> might take many cut-and-try attempts before I had just what I wanted.
> This would be very inefficient for both the ISP and for me.

Only "many" attempts? Gosh, took me thousands of attempts
just to figure out how to configure a simple script to
come up and run. Well, maybe not thousands but it sure
took me long enough to figure out ASCII upload, permissions,
POST method not allowed and all those other annoying features
of a server, to overcome as a fresh beginner.

If I had it to do again, I would research basics
of setting up a cgi script on a server before
doing anything else. Sure would have saved me
a lot of frustration and headaches.
 
> Is there a way for me find an ISP that would allow me to 
> experiment with Perl scripting?

There are lots and lots of sites which will host 
scripts for you, free of charge. As always, a catch
is involved. They will require you to display their
logo or advertisements on your 'homepage' at their
site. What the heck, create a homepage (smiles) then
have fun experimenting with scripts.

Human nature comes into play on this. I am not so sure,
although the right thing to do, if contacting a host
first and asking about running a script will yield the
type of results you want. Asking first, for some hosts,
will cause suspicion or concern, "no" might be an answer.
My personal concern would to be sure I don't upload a
script which could be dangerous, or cause problems for
a host. An example would be creating an infinite loop
and having your script eat up CPU facilities by running
seemingly forever. Another example would be uploading
a script which would open up a server to hacking.

Run an internet search on free hosting using selected
search terms. You will find hundreds of sites which
will run your scripts for you, in exchange for your
advertising their site. Exercise caution and respect
for a site; it is free.

Hmm... hypermart, angelfire, geocities and others
like this would be examples of free sites although
I am not sure which offer script hosting.

Oh yes, if you are planning on running your scripts
via a command line screen on your home system, this
is highly unlikely. Free servers rarely allow this.
Telnet would an option to look into at a server.
Still, learning to run your script as cgi from a
web interface, would be a wiser choice and afford
you greater learning on lots of stuff! Same script,
just a different interface, don't you think?


Godzilla!


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

Date: Sun, 21 May 2000 11:58:04 -0700
From: samurai@metallicafan.com
Subject: Re: ISP for experimenting?
Message-Id: <392831BC.5C6494F0@metallicafan.com>

Bob Margulies wrote:

> Is there a way for me find an ISP that would allow me to experiment with
> Perl scripting?

    Two off the top of my head are http://free.prohosting.com , which has
cgi access, but no command line [and lots of banners :-( ], and
hobbiton.org, which lets you telnet in and command line run.  Both free, of
course.
    ///



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

Date: Sun, 21 May 2000 22:07:03 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: ISP for experimenting?
Message-Id: <Pine.GHP.4.21.0005212159150.27796-100000@hpplus01.cern.ch>

On Sun, 21 May 2000, Bob Margulies wrote:

> I am interested in doing some server-side Perl programming. This would
> require me to install a script in my directory on my ISP's site, which I
> would then run from my Windows 98 computer. When I asked my ISP how I
> might go about this, I was told to submit the script to them, and after
> they inspected and approved it, they would install it for me.
[...]
> Is there a way for me find an ISP that would allow me to experiment with
> Perl scripting?

I strongly recommend you to install activePerl and a web server - I
would use Win32 Apache myself - on your own machine for your
experiments and development.  You don't have to be online to use
these, you can talk from your browser to your server and its scripts
"in the privacy of" localhost.

As long as you stick with portable programming techniques, avoiding
anything that is Windows-specific, your resulting scripts should 
work fine on whatever your ISP runs (which has a pretty good chance of
being Apache anyway).

There are _some_ limitations from running Win9x as against /NT, but
as a relative beginner I doubt that you'd find those a problem in 
practice.

good luck



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

Date: Sun, 21 May 2000 20:09:29 GMT
From: edelwater@my-deja.com
Subject: loading a bunch of urls
Message-Id: <8g9fpk$n9s$1@nnrp1.deja.com>

hmmm.... thinking if perl is the right lang for this...but ok:
1. i want to have a piece of perl on a server.
2. this should be loaded by like 150 seperate locations
   through a browser where it automatically goes through   several urls
3. when finished it writes the time to a file (needed to
   load all the urls e.g. in a frame)any ideas ?? >>
nederland@anytimenow.com


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 21 May 2000 21:12:58 GMT
From: py1ll@my-deja.com
Subject: PERL and CGI
Message-Id: <8g9jgm$pce$1@nnrp1.deja.com>

I want to call a PERL program to perform some task in the server site
without returning ANYTHING to the HTML calling page. This, normally,
generates an error message (there is no data.... etc.) in the browser
and stops the process. How to avoid that message and with no stop? Is it
a matter of the http server?

--
Greetings,

Luiz - PY1LL


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 21 May 2000 14:29:30 -0700
From: asound <asound40NOasSPAM@hotmail.com.invalid>
Subject: Re: PERL and CGI
Message-Id: <0228fbb6.429b1a00@usw-ex0104-033.remarq.com>

In article <8g9jgm$pce$1@nnrp1.deja.com>, py1ll@my-deja.com
wrote:
>I want to call a PERL program to perform some task in the server
site
>without returning ANYTHING to the HTML calling page. This,
normally,
>generates an error message (there is no data.... etc.) in the
browser
>and stops the process. How to avoid that message and with no
stop? Is it
>a matter of the http server?

Yes it is.
But you can send HTTP status code 204 from the server.
Which means, that the request was successful but did not return
any data to send to the client (besides the header)

HTH

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 21 May 2000 21:18:00 GMT
From: py1ll@my-deja.com
Subject: PERL and COM port
Message-Id: <8g9jq3$plc$1@nnrp1.deja.com>

Which script could I use to access (read and write) a COM port using
PERL? I run under W98.
I have a script that only works fine and indefinitely if I use, before,
an access to the port from a terminal program (like HYERTERMINAL). It
seems to be a question of bad initialization.

--
Greetings,

Luiz - PY1LL


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sun, 21 May 2000 18:53:06 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: perl to lunch "Save As" browser window ???
Message-Id: <mgWV4.83267$h01.596218@news1.rdc1.mi.home.com>

[Posted and mailed to original poster]

In article <87r9axyq6h.fsf@limey.hpcc.uh.edu>,
	Tony Curtis <tony_curtis32@yahoo.com> writes:
>>> On 20 May 2000 17:39:12 GMT,
>>> teety99@hotmail.com (teety) said:
> 
>>     	I have links in My HTML Page.This link is a perl
>> script link.when click on this link.The perl will do
>> something by following the script (don't care this).
>               ^^
> Not sure what this means...
> 
>> And after at I want perl script to lunch a "Save As"
>> browser window.For save some file.  How I lunch this
>> "Save As" window ???
> 
> I'm afraid you can't.

Well, you can.  Just about.  Sending data back with the MIME type
"application/octet-stream" causes every browser that I know of to
prompt with the "Save As/Open With" dialog that's appropriate for 
that browser...

Exactly how to do this is covered in the CGI.pm documentation, and
the why of it is best covered in a CGI/Web newsgroup.  Not here.

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Sun, 21 May 2000 21:55:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: perl to lunch "Save As" browser window ???
Message-Id: <Pine.GHP.4.21.0005212108190.27796-100000@hpplus01.cern.ch>


On Sun, 21 May 2000, Clinton A. Pierce wrote:

> Well, you can.  Just about.  Sending data back with the MIME type
> "application/octet-stream" causes every browser that I know of to
> prompt with the "Save As/Open With" dialog 

And here we go around again....

There's a rather popular exception to that.  Some people would rule it
out as a "web browser", since it so crassly violates many of the web
specifications.  But it's rather popular, regardless, if only because
it comes bundled with the vendor's OS.

> Exactly how to do this is covered in the CGI.pm documentation,

That tells you how to send a specific content-type, yes, but does
not discuss what settings should be used for this purpose.

Here's an application/octet-stream document:
http://ppewww.ph.gla.ac.uk/~flavell/checksec/checkdoc1.bin
, as you could, for example, verify with lynx -head -dump

Try it with Win MSIE, I suspect you'll get the same results that I do.

> the why of it is best covered in a CGI/Web newsgroup.  Not here.

Now, on that point I fully agree; contrary to popular belief I don't
actually enjoy heckling people on usenet, but when an answer is given,
I _do_ like to see it being accurate, both as to principles and as to
the shortcomings found in practice.  

[f'ups prophylactically set]



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

Date: Sun, 21 May 2000 22:00:15 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: perl to lunch "Save As" browser window ???
Message-Id: <392a580b.3502457@news.skynet.be>

Alan J. Flavell wrote:

>> print "Content-Disposition: attachment ; filename=$my_filename\n";
>> print "Content-type: application/x-zip-compressed\n\n"; 
>> print $buffer;
>
>Right, I just tried that: the browser announced "Opening foo.bar using
>Wiz.exe".  (As I knew it would).

Then, according to RFC 2183, your browser behaves wrongly.
<http://www.nic.mil/ftp/rfc/rfc2183.txt>. Your "viewer" (wiz.exe) should
only open the file if you specifically request it to. Quote:

 3.  Examples

   Here is a an example of a body part containing a JPEG image that is
   intended to be viewed by the user immediately:

        Content-Type: image/jpeg
        Content-Disposition: inline
        Content-Description: just a small picture of me

         <jpeg data>


   The following body part contains a JPEG image that should be
   displayed to the user only if the user requests it. If the JPEG is
   written to a file, the file should be named "genome.jpg".

-- 
	Bart.


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

Date: Mon, 22 May 2000 07:42:19 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: regexes *sigh* damn I hate these things
Message-Id: <958938108.694352@shelley.paradise.net.nz>


"Sue Spence" <sue@pennine.com> wrote in message
news:8g8eqj$a3d@drn.newsguy.com...
> In article <392758E6.577C8C74@stomp.stomp.tokyo>, "Godzilla!" says...
> >Why bother with a possibly error prone
> >fancy regex when you can jump right in,
> >grab your number, jump out, and move on
> >with your program?
> >
> >Try this and see if this simple little
> >old fashion whatever doesn't grab your
> >number of interest each and everytime,
> >with no fancy footwork.
> >
> >#!/usr/local/bin/perl
> >
> >print "Content-Type: text/plain\n\n";
> >
> >$input = "
> ><p>Name:  <a href=\"http://www.planetunreal.com/dl/nc.asp?nalicity/
> >utdm/dm-distinctive.zip\">DM-Distinctive</a><br>
> >Author:<a href=\"mailto:bastiaan_frank\@hotmail.com\">Bastiaan
> >Frank</a><br>
> >Rating: (1-10) 9.5</p><!-- add correct image name below here -->
> ><img align=\"right\" border=\"0\" hspace=\"10\" vspace=\"10\"
> >width=\"231\" height=\"173\"
> >src=\"dm-distinctive.jpg\">";
> >
> >if ($input =~ / ([0-9\.]+)/)
> > { $input = $1; }
> >
> >print $input;
> >
> >exit;
>
>
> Did you try this program, "Godzilla!"?  I pasted the code from your
posting into
> a file and attempted to run it, but received nothing except syntax errors
for my
> trouble.  I submit that this is not helpful to people, yet your
introduction to
> your code was highly confident.  How about coming back with code that will
> compile, run and provide the right answer?

As scary as it maybe, the code supplied is syntactically correct.  You must
have had problems doing a cut and paste.




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

Date: 21 May 2000 14:17:17 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: regexes *sigh* damn I hate these things
Message-Id: <8g9jot$24pp@drn.newsguy.com>

In article <392806DD.6A0C6C4C@stomp.stomp.tokyo>, "Godzilla!" says...
>
>Sue Spence wrote:
>
>> I submit that this is not helpful to people, yet your 
>> introduction to your code was highly confident.  
>> How about coming back with code that will
>> compile, run and provide the right answer?
>
>
>
>I submit you don't know how to run a Perl program.

I do, but I am not always perfect at cut & paste.  Your program looked unusual
enough to me that I punted it before checking further.  I have already
apologized once for this, but I don't mind apologizing again.  I'm sorry about
that.

>As it is, I tested this no less than twenty to
>twenty-five times. Works perfect without failure.

Very good.     

>
>I test all of my code, harshly, before posting,
>knowing some of you less-than-skilled people will 
>be all over it like flies on fresh mule manure.
>

You know, I can't quite agree with this, but I've already made my main concern
known in my other posting.  I'm not really into personal slanging matches in
technical newsgroups, so don't imagine you'll get me down to your own level like
this.



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

Date: Sun, 21 May 2000 20:11:10 GMT
From: Ed Costello <ecostello@home.com>
Subject: Suggest an approach for HTML Form submission
Message-Id: <392842DE.FA5478FB@home.com>

This is a multi-part message in MIME format.
--------------40D4BF8A7132413D44AA7C6A
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

Greetings,

I need to create a Macintosh Perl program that mimics an HTML form submission
to a web server and parses the resulting page.  I have MacPerl installed, but
I'm not sure I have all the appropriate modules, libraries, packages, etc...

Could someone point me in the right direction or suggest an approach?

Cheers!

Ed Costello
Million Monkeys
perl@million-monkeys.com

--------------40D4BF8A7132413D44AA7C6A
Content-Type: text/x-vcard; charset=us-ascii;
 name="ecostello.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ed Costello
Content-Disposition: attachment;
 filename="ecostello.vcf"

begin:vcard 
n:Costello;Ed
x-mozilla-html:FALSE
url:http://www.million-monkeys.com
org:Million Monkeys
adr:;;;;;;
version:2.1
email;internet:news@million-monkeys.com
title:Owner
x-mozilla-cpt:;1
fn:Ed Costello
end:vcard

--------------40D4BF8A7132413D44AA7C6A--



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

Date: Mon, 22 May 2000 07:56:32 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: the use of $_
Message-Id: <958938961.716827@shelley.paradise.net.nz>


"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:39281AD2.8B439E31@stomp.stomp.tokyo...
> > Reason 7 is if you're stuck with perl 4.  ''I am stuck with perl 4''
> > is never *good* reason to do *anything*, except maybe to cut your
> > wrists or something.
>
> Perl 4 is still currently shipped with some
> operating system packages and, Perl 4 concerns
> are posted here at times. Perl 4 is still quite
> viable and of concern to many. To shun posters
> here for use of Perl 4 or to shun those who are
> stuck with Perl 4, is most illogical, unrealistic
> and perhaps, an act of technological bigotry.

Please name me just one current Operating System that comes with Perl 4.

> Skilled and imaginative programmers routinely
> make use of Perl 4 to write great programs and,
> have no need for copy and paste Perl 5.

Name me one example.






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

Date: Sun, 21 May 2000 18:48:02 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: valid email address
Message-Id: <39282f30.435796171@news.nikoma.de>

On Sun, 21 May 2000 07:44:31 GMT, Uri Guttman <uri@sysarch.com> wrote:

>>>>>> "TEB" == The Evil Beaver <evilbeaver.picksoft@NOSPAMzext.net> writes:
>
>  TEB> /(\w+)\@(\w)(\w+).(\w)(\w+)/
>  TEB> or something similar.
>
>or something wrong. that fails in so many ways such as 3 level domain names.

No, since there's no $ at the end of the regex. But won't match, for
example, one-letter domain elements such as x.org.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.


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

Date: Sun, 21 May 2000 18:50:22 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: valid email address
Message-Id: <39282fd0.435955652@news.nikoma.de>

On Sun, 21 May 2000 14:13:25 GMT, "red [2]" <reevesg@cableinet.co.ukx>
wrote:

>you could split it after the @ and do a whois lookup to find out if its a
>real domain....

More appropriate would be a DNS lookup for an MX record or records.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.


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

Date: 21 May 2000 14:00:16 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: valid email address
Message-Id: <87puqfohj3.fsf@limey.hpcc.uh.edu>

>> On Sun, 21 May 2000 18:50:22 GMT,
>> nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton) said:

> On Sun, 21 May 2000 14:13:25 GMT, "red [2]"
> <reevesg@cableinet.co.ukx> wrote:

>> you could split it after the @ and do a whois lookup to
>> find out if its a real domain....

> More appropriate would be a DNS lookup for an MX record
> or records.

Or an A record for the RHS (after the @) since you can
deliver directly to a machine too.

A walk up the parts of the RHS looking for a valid MX
record might be one solution you could try.

But I fear this is getting off-topic for clpm.

hth
t


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

Date: Sun, 21 May 2000 20:34:40 GMT
From: "The Evil Beaver" <evilbeaver.picksoft@NOSPAMzext.net>
Subject: Re: valid email address
Message-Id: <ALXV4.218255$Kv2.321403@quark.idirect.com>


Philip 'Yes, that's my address' Newton <nospam.newton@gmx.li> wrote...
> On Sun, 21 May 2000 07:44:31 GMT, Uri Guttman <uri@sysarch.com> wrote:
>
> >>>>>> "TEB" == The Evil Beaver <evilbeaver.picksoft@NOSPAMzext.net>
writes:
> >
> >  TEB> /(\w+)\@(\w)(\w+).(\w)(\w+)/
> >  TEB> or something similar.
> >
> >or something wrong. that fails in so many ways such as 3 level domain
names.
>
> No, since there's no $ at the end of the regex. But won't match, for
> example, one-letter domain elements such as x.org.
Well, Jennifer stated "I'm thinking that if it isn't
any_char@any_two_char.any_two_char
that it isn't valid syntax." which says right there to avoid x.org or any
other one letter sld.

--
The Evil Beaver <evilbeaver.picksoft@NOSPAMzext.net>
-- Remove NOSPAM to e-mail me.
This message ROT-13 encrypted twice for extra security.





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

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


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