[16654] in Perl-Users-Digest
Perl-Users Digest, Issue: 4066 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 19 14:06:14 2000
Date: Sat, 19 Aug 2000 11:05:16 -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: <966708315-v9-i4066@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 19 Aug 2000 Volume: 9 Number: 4066
Today's topics:
Advice on CDV routines needed... <j.boocock@NOSPAMvirgin.net>
Can't get a simple GETHOSTBYADDR() to work <sborruso@stny.rr.com>
Re: Can't get a simple GETHOSTBYADDR() to work (David Efflandt)
Re: change ',' to '","' (Marcel Grunauer)
Re: change ',' to '","' <lr@hpl.hp.com>
Re: change ',' to '","' (Marcel Grunauer)
Re: cross platform newline processing (Eric Bohlman)
Re: cross platform newline processing <flavell@mail.cern.ch>
Re: cross platform newline processing (Keith Calvert Ivey)
Re: cross platform newline processing <flavell@mail.cern.ch>
Re: Download a file (Ken Loomis)
Re: Download a file (Ken Loomis)
Re: Embedding Perl (Logan Shaw)
Re: Embedding Perl <lr@hpl.hp.com>
Re: Eval and Regexps Help <mauldin@netstorm.net>
Re: Eval and Regexps Help bluearchtop@my-deja.com
Re: Eval and Regexps Help (Martien Verbruggen)
Re: Following Hyperlinks with cgi <adams1015@worldnet.att.net>
Re: Following Hyperlinks with cgi <adams1015@worldnet.att.net>
Re: Following Hyperlinks with cgi <godzilla@stomp.stomp.tokyo>
Re: Following Hyperlinks with cgi <adams1015@worldnet.att.net>
GD.pm problems, can't install and I need it <zacarias@teleline.es>
Re: GD.pm problems, can't install and I need it <katz@underlevel.net>
Re: help foreach doesn't work (Abigail)
Re: help foreach doesn't work (Martien Verbruggen)
Re: help foreach doesn't work j355@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 19 Aug 2000 18:08:47 +0100
From: "John B" <j.boocock@NOSPAMvirgin.net>
Subject: Advice on CDV routines needed...
Message-Id: <8nmf1l$9r1$1@newsg1.svr.pol.co.uk>
Hi all !
I'm quite new to perl, although I'm somewhat familiar with Korn shell
scripts, I was just wondering does anyone have any good pointers for writing
check digit validation routines (CDV) for validating data inputted into HTML
forms. Some simple Java script would probably be used to check that the
forms had been filled in, etc. before being passed to a CGI perl script for
proper validation of input on the one area of the form which contains the
number to be veryfied. If successfully veryfied then the contents of the
whole form would be written to a file.
Ideally the perl script would have to be fairly flexible as the CDV routine
is likely to be changed from time to time. The script would have to be able
to have the weightings, mask and modulus specified somewhere in the script
rather than having the whole script re-written everytime the CDV routine
changes.
I'm sure that there is probably a number of scripts out there which already
do this, but would preferably like to write my own. I've had a look at the
code for a few similar number validation but most have the checking routines
specicified quite explicitly within the code.
Any help would greatly be appreciated !
Cheers
John B
------------------------------
Date: Sat, 19 Aug 2000 15:26:00 GMT
From: Steve Borruso <sborruso@stny.rr.com>
Subject: Can't get a simple GETHOSTBYADDR() to work
Message-Id: <399EA428.69D69187@stny.rr.com>
Greetings,
I've tried folllowing countless examples, found on the net, to issue a
gethostbyaddr() but nothing is ever
returned when I issue the function. I've recoded this several ways and
just can't get anythiing to return.
I'm running on SunOS 5.7
Any help is appreciated !!
Steve Borruso
use LWP::Socket;
($leftpart, $restofline) = split(/$slashes/, $urlist[$i], 2);
# Parsing out the hostname part of the url
($maybehost, $endofline) = split(/$slash/, $restofline, 2); #
Should have host name or IPaddress now
if($maybehost !~ m/[A-Za-z]/) { # If no chars exist
then it must be an IP address
$maybehost =~ tr/./ /; # Get rid of
the dots
($IPaddr1, $IPaddr2, $IPaddr3, $IPaddr4) = split(/ /,
$maybehost, 4); #Parse it by blanks into respective IP addr pieces
chomp($IPaddr1); # Yes I know
there are easier ways
chomp($IPaddr2);
chomp($IPaddr3);
chomp($IPaddr4);
@IPnums=($IPaddr1,$IPaddr2,$IPaddr3,$IPaddr4); # Put pieces
in a list (this is how the example says to do it)
# @IPnums=(216,32,245,142); # Even tried
hardcoding an address, still didn't work
$IPaddr=pack('C4',@IPnums); # Have no clue what
this is doing but everyplace says to do it
($name,$alias,$adrtype,$length,@address)=
gethostbyaddr($IPaddr,AF_INET); # Issue the function
print "Resolved hostname is $name alias is $alias address is
@address length is $length type is $adrtype <br> ";
}
------------------------------
Date: Sat, 19 Aug 2000 17:29:22 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Can't get a simple GETHOSTBYADDR() to work
Message-Id: <slrn8ptgvg.5e6.efflandt@efflandt.xnet.com>
On Sat, 19 Aug 2000 15:26:00 GMT, Steve Borruso <sborruso@stny.rr.com> wrote:
>
>I've tried folllowing countless examples, found on the net, to issue a
>gethostbyaddr() but nothing is ever
>returned when I issue the function. I've recoded this several ways and
>just can't get anythiing to return.
>
>I'm running on SunOS 5.7
You appear to be making this more complicated than necessary. I have no
idea about the format of your data, but first make sure that you can
reliably parse out the hostnames or IPs you want to lookup.
The following is a commandline script that works in both Linux and Solaris
for IP, hostname, or even those all number names that porno sites use:
use Socket;
if ($ARGV[0]) {
$host = shift;
} else {
print "Enter host to resolve on command line\n";
exit;
}
print "Host: $host\n";
$ip = scalar gethostbyname($host);
@ip = unpack("C4",$ip);
$ip = join(".",@ip);
print "IP: $ip\n";
$rhost = gethostbyaddr(inet_aton($ip), AF_INET);
print "Reverse lookup: $rhost\n\n";
# I added following to show output data you are looking for:
($name,$alias,$adrtype,$length,@address) =
gethostbyaddr(inet_aton($ip),AF_INET);
print "Resolved hostname is $name\nalias is $alias\naddress is ";
foreach (@address) {
@ip = unpack("C4",$_);
print join(".",@ip)," ";
}
print "\nlength is $length\ntype is $adrtype\n";
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sat, 19 Aug 2000 13:37:00 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: change ',' to '","'
Message-Id: <slrn8pt3a9.48d.marcel@gandalf.local>
On Fri, 18 Aug 2000 23:39:34 GMT, arthur <star@sonic.net> wrote:
>I have a form that returns 'question' and prints it on dat.html. I want to
>be able to put quotation marks on both sides of any commas that are in
>'question' and print it on dat.html..
>
>Lets say someone put "hi,bye" in the form I want "hi","bye" to be printed on
>the form.
my ($question = param('question')) =~ s/,/","/g;
--
Marcel Gr\"unauer - Codewerk plc . . . . . . . . . . . <http://www.codewerk.com>
Perl Consulting, Programming, Training, Code review . . . <marcel@codewerk.com>
mod_perl, XML solutions - email for consultancy availability
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Sat, 19 Aug 2000 08:52:18 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: change ',' to '","'
Message-Id: <MPG.14084d0b3645ef8498aca2@nntp.hpl.hp.com>
In article <slrn8pt3a9.48d.marcel@gandalf.local>, marcel@codewerk.com
says...
> On Fri, 18 Aug 2000 23:39:34 GMT, arthur <star@sonic.net> wrote:
>
> >I have a form that returns 'question' and prints it on dat.html. I want to
> >be able to put quotation marks on both sides of any commas that are in
> >'question' and print it on dat.html..
> >
> >Lets say someone put "hi,bye" in the form I want "hi","bye" to be printed on
> >the form.
>
>
> my ($question = param('question')) =~ s/,/","/g;
That doesn't compile. Did you test it before posting?
Move the 'my' inside the parentheses.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 19 Aug 2000 16:11:02 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: change ',' to '","'
Message-Id: <slrn8ptcca.6ea.marcel@gandalf.local>
On Sat, 19 Aug 2000 08:52:18 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>In article <slrn8pt3a9.48d.marcel@gandalf.local>, marcel@codewerk.com
>says...
>> On Fri, 18 Aug 2000 23:39:34 GMT, arthur <star@sonic.net> wrote:
>>
>> >I have a form that returns 'question' and prints it on dat.html. I want to
>> >be able to put quotation marks on both sides of any commas that are in
>> >'question' and print it on dat.html..
>> >
>> >Lets say someone put "hi,bye" in the form I want "hi","bye" to be printed on
>> >the form.
>>
>>
>> my ($question = param('question')) =~ s/,/","/g;
>
>That doesn't compile. Did you test it before posting?
Hmmpf. Yes, I did, but then, in an effort to "be good and use strict",
I added my. Without testing...
--
Marcel Gr\"unauer - Codewerk plc . . . . . . . . . . . <http://www.codewerk.com>
Perl Consulting, Programming, Training, Code review . . . <marcel@codewerk.com>
mod_perl, XML solutions - email for consultancy availability
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: 19 Aug 2000 13:12:04 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: cross platform newline processing
Message-Id: <8nm134$82e$2@slb7.atl.mindspring.net>
Alan J. Flavell (flavell@mail.cern.ch) wrote:
: But when required to handle cross-platform text of this kind, I would
: open the stream in binmode, and would write the code in terms of the
: binary representations \015 and \012. Since $/ can't be set to
: several alternatives at the same time, I wouldn't use it, but would
: use some other coding for breaking up the binary chunks into
: lines/records (call them what you will).
Translating a \015 optionally followed by a \012 into a single \n would
work *if* the file contained no "irregular" line endings. The tricky part
would be deciding what to do if the file contained, say, an LFCR pair, or
a CR followed by multiple consecutive LFs, or contained both LFs and CRs
that weren't adjacent. How, for example, should a run of text followed by
a CR followed by a run of the same text followed by a CRLF be treated
(presumably an attempt to create bold text on a line printer)? What if
the two runs of text weren't identical?
------------------------------
Date: Sat, 19 Aug 2000 16:00:40 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: cross platform newline processing
Message-Id: <Pine.GHP.4.21.0008191547520.4213-100000@hpplus03.cern.ch>
On 19 Aug 2000, Eric Bohlman wrote:
> The tricky part
> would be deciding what to do if the file contained, say, an LFCR pair, or
> a CR followed by multiple consecutive LFs, or contained both LFs and CRs
> that weren't adjacent.
Quite. You may need to have some kind of hypothesis as to how the
file came into existence.
> How, for example, should a run of text followed by
> a CR followed by a run of the same text followed by a CRLF be treated
> (presumably an attempt to create bold text on a line printer)?
That kind-of supports my point. The files that I had been dealing
with had all been attempts to create some kind of plain-text _input_
file, and had gone wrong because someone switched platform - in some
cases even switching platform more than once, Mac/Windows/Unix -
while attempting to edit the file. These are situations that I've had
to deal with in practice in the past.
In that kind of context, I'd be inclined to treat isolated CR or LF as
(Mac, unix resp) newlines, CR+LF as DOS/Windows/VMS newline, and,
for want of any better idea, CR+CR+LF or CR+LF+LF or LF+CR as two
newlines. Such files would never have been intended to achieve
overtyping by using isolated CR.
What _you're_ talking about seems to be a file that had been created
as some kind of device-driving format. Which is even worse, and seems
to call for even more imagination about both how the file came into
being and what it was intended to achieve. And then you risk getting
all the other oddities that happen in that kind of situation, such as
backspacing, tabs, even reverse-linefeeds and stuff. Shudder.
cheers
------------------------------
Date: Sat, 19 Aug 2000 14:27:03 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: cross platform newline processing
Message-Id: <399e9369.2286555@news.newsguy.com>
"Alan J. Flavell" <flavell@mail.cern.ch> wrote:
>No argument with any of that, but it only seems to state the problems,
>rather than offering an agenda for a solution.
Malcolm Dew-Jones had already given a solution that seemed like
the way to go (read enough of the file to determine the line
separator, then set $/ and reread), so I concentrated on
correcting Bob Walton's misstatement.
Malcolm didn't give any code for setting $/, but it would go
something like this:
open IN, "< $file" or die "Can't open $file: $!";
binmode IN;
my $chunk;
read IN, $chunk, 256;
($/) = $chunk =~ /(\015\012?|\012)/
or die "Can't find line separator";
seek IN, 0, 0;
while (<IN>) {
chomp;
# process line in $_ -- for example:
print "$.: $_\n";
}
If the file will fit into memory, I might slurp the whole thing
(in binmode) and then use split(). That solution would also
work with the chimeric files you mentioned, in which the line
separator may vary from line to line. Something like this:
binmode IN;
{ local $/; $_ = <IN>; }
@lines = split /\015\012?|\012/;
for (@lines) {
# process $_
}
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Sat, 19 Aug 2000 17:58:30 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: cross platform newline processing
Message-Id: <Pine.GHP.4.21.0008191755350.4213-100000@hpplus03.cern.ch>
On Sat, 19 Aug 2000, Keith Calvert Ivey wrote:
> "Alan J. Flavell" <flavell@mail.cern.ch> wrote:
>
> >No argument with any of that, but it only seems to state the problems,
> >rather than offering an agenda for a solution.
>
> Malcolm Dew-Jones had already given a solution [...]
I'm sorry, that comment of mine came out harsher than it had been
intended; and actually hadn't been addressed to yourself.
> that seemed like the way to go
Well, one way or another, I guess anyone with a requirement in this
area has now been presented with sufficient options to be able to make
a choice ;-)
All the best
------------------------------
Date: Sat, 19 Aug 2000 14:10:10 GMT
From: nospam@nospam.com (Ken Loomis)
Subject: Re: Download a file
Message-Id: <399e94d8.15392298@news.tiac.net>
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>On Fri, 18 Aug 2000 20:12:03 GMT Ken Loomis wrote:
>> Hello:
>>
>> What is the perl command to download a file from within a cgi
>> response?
>>
>
>print
>
hmm, I think I need more info than that. a simple:
print "http://blah.blah.zip"
didn't work.
Is there more to know?
Ken
------------------------------
Date: Sat, 19 Aug 2000 14:24:08 GMT
From: nospam@nospam.com (Ken Loomis)
Subject: Re: Download a file
Message-Id: <399e96c3.15883065@news.tiac.net>
Drew Simonis <care227@attglobal.net> wrote:
>
>Can you be more specific? Not sure this quite makes sense.
Sorry, this is probably such a simple thing....
I want the web user to enter data into a form and submit it and then
receive a download. I've got a servicable cgi script using Perl for
sending data via e-mail but now I want to initiate a download.
By qualifier page, I mean, the visitor has to enter some identifying
information before receiving the download.
So I'm thinking I would just modify current cgi routine to add a
download. I would get an email with the users info, the user gets the
download.
So it would be "if data is there, you get the download."
------------------------------
Date: 19 Aug 2000 08:47:19 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Embedding Perl
Message-Id: <8nm357$lme$1@provolone.cs.utexas.edu>
In article <8nlo2g$dad$1@nnrp1.deja.com>, <akdwivedi@hotmail.com> wrote:
>Hi,
>
>I need to embed Perl in my C++ code.. I went through the perlembed
>documentation and it's good for startups.. But I couldn't get advanced
>topics like handling files descriptors/handles from the embedded perl..
>I need some help in passing the file handle from and to the
>perlscripts.. Any reference to some examples and reference code would be
>a big help...
If this is Unix, you could probably pass file numbers. If you pass "4"
into the perl code, you can then open file #4 as a perl filehandle
by doing this:
open (FOO, '<&=4')
I'm not sure of how to do the reverse, although I suspect there's a
way.
By the way, if you do this, you're going to end up mixing perl's I/O
buffering with C++'s, at least unless you use syswrite() and sysread()
under perl.
- Logan
------------------------------
Date: Sat, 19 Aug 2000 08:59:41 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Embedding Perl
Message-Id: <MPG.14084ecbd29d667898aca3@nntp.hpl.hp.com>
In article <8nm357$lme$1@provolone.cs.utexas.edu>, logan@cs.utexas.edu
says...
...
> By the way, if you do this, you're going to end up mixing perl's I/O
> buffering with C++'s, at least unless you use syswrite() and sysread()
> under perl.
I wonder if there is a problem. As the perl code and the C++ code are
bound into one executable, wouldn't they each end up calling the same
functions in te C I/O library, and using the same buffers?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 19 Aug 2000 13:25:52 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Eval and Regexps Help
Message-Id: <399E8A31.C28F67ED@netstorm.net>
bluearchtop@my-deja.com wrote:
>
> > what you're really trying to do is print everything outside of <%%>s
> and
> > execute everything inside <%%> .. your simple substitution will not
> > accomplish this
>
> Yes, that is exactly correct. Can you point me in the right direction
> for doing this?
>
> I want everything inside the <% %> to be executed.
>
This struck me as a bizarre but interesting thing to want to do. I
assume you mean that everything should come out in the same order as it
appears in $str except the eval'ed parts get eval'ed.
The least I can boil this down to is:
$str =~ s/(.*?)<%(.*?)%>/print $1 and not eval $2/esg, print $str;
This will give you anything that remains in $str beyond last match,
which in your example is only a newline char.
-- Jim
------------------------------
Date: Sat, 19 Aug 2000 13:29:04 GMT
From: bluearchtop@my-deja.com
Subject: Re: Eval and Regexps Help
Message-Id: <8nm22m$n5q$1@nnrp1.deja.com>
In article <8nm002$82e$1@slb7.atl.mindspring.net>,
ebohlman@netcom.com (Eric Bohlman) wrote:
> bluearchtop@my-deja.com wrote:
> : Thanks, that works, but I don't understand why that would work but
this
> : won't:
> : <%
> : $x = '';
> : for ($i = 1; $i < 11; $i++)
> : {
> : $x = "$i ";
> : $x;
> : }
> : %>
> :
> : Why does it tell me that the variable still has a void context?
>
> Because "$x;" appears inside a loop, which isn't a place where a
> statement in void context can return a value. If you move it
*outside*
> the loop, you don't get a warning because it's now the last statement
in
> a sequence of statements being eval'd, and that *is* a place where it
can
> return a value; the value of eval'ing a string consisting of a
sequence
> of statements is the value of the last statement (as you have it now,
the
> last statement in the sequence is actually the for loop).
Ah, Ok, thanks. I didn't realize it would only return the last line.
Is there a better way to do this if I wanted it to evaluate/return each
line?
i.e.
<%
$x=1;
$y=2;
$x."\n";
$y."\n";
%>
I would want this to print:
1
2
What I'm really trying to do is have everything within <% %> run like a
little perl program, using the existing variable context.....
I know I could do:
<%
$x
%>
<%
$y
%>
But I'm looking for something a little nicer than that where I can do a
whole block of code.....
Thanks for all your help so far!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 19 Aug 2000 15:00:15 GMT
From: mgjv@martien.heliotrope.home (Martien Verbruggen)
Subject: Re: Eval and Regexps Help
Message-Id: <slrn8pt67t.n7v.mgjv@martien.heliotrope.home>
On Sat, 19 Aug 2000 13:29:04 GMT,
bluearchtop@my-deja.com <bluearchtop@my-deja.com> wrote:
>
> Is there a better way to do this if I wanted it to evaluate/return each
> line?
>
> i.e.
>
> <%
> $x=1;
> $y=2;
> $x."\n";
> $y."\n";
> %>
>
> I would want this to print:
> 1
> 2
<%
$x = 1;
$y = 1;
"$x\n$y\n"
%>
Martien
--
Martien Verbruggen |
Interactive Media Division | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd. | make up 3/4 of the population.
NSW, Australia |
------------------------------
Date: Sat, 19 Aug 2000 14:41:34 GMT
From: "Jeremiah Adams" <adams1015@worldnet.att.net>
Subject: Re: Following Hyperlinks with cgi
Message-Id: <y0xn5.16786$4T.1004028@bgtnsc07-news.ops.worldnet.att.net>
Godzilla! wrote in message
>
> I am curious though. If you already have a link to a
> site, couldn't you discover what is there by following
> this link via your browser? This is faster and certainly
> more efficient than using Perl for this task.
>
> Godzilla!
Here's the deal. The script will be posting the same information to several
cgi scripts hosted on other servers, run by other companies. I just want to
post the information too all the sites at once and check the returned html
for certain text. That way I can code some error handleing in case the
hosts have changed the parameters for the posts to thier scripts.
------------------------------
Date: Sat, 19 Aug 2000 15:09:32 GMT
From: "Jeremiah Adams" <adams1015@worldnet.att.net>
Subject: Re: Following Hyperlinks with cgi
Message-Id: <Mqxn5.16858$4T.1006183@bgtnsc07-news.ops.worldnet.att.net>
Jeremiah Adams wrote in message
This is a bit off topic here but after reading all the posts to my message
I've got a little question of two. First let me say that I havn't posted to
this news group in some time. I havn't been doing much with perl lately.When
did this newsgroup become so unkind? I can't believe I actually have seen
profanity in a post on this group. Is that really necessary? Who cares if
you know more? Thats what I thought this group was for- to get a little help
when you need it. I've got 10 responses to the original post of wich only
two or so provided any positive direction for me to move in. (btw thanks,
but I've decided to build a desktop application instead of running it from a
cgi script.) I started to reply to some of the individual posts but I
realized I was falling right in step with you all. Learn a little couth when
correcting someone. They might actually recieve it! I know I probably
shouldn't bother with this- I'm sure I'll get flamed for saying anything but
thats ok it won't be the first time and it certainly wont me the last. I've
never been real good at quoting scripture and remember names and verses and
such but the written word of God says something to this effect:
From out of the abundance of the heart the mouth speaks.
Basically that means that what ever comes out of your mouth really comes
from the state of your heart. So if you speak kind words - kindness dweals
in your heart. If yous speak hatefull words- hate dweals in your heart. Your
mouth is a reflection of the state of your soul.
Understand that I'm not trying to insult you. I am trying to point out that
we (who read and post to and from this group) are human beings with real
thought, loves, passions and emotions. Would you actually speak face to face
to one another in the manner you illustrated with your posts? I think not.
jeremiah
------------------------------
Date: Sat, 19 Aug 2000 08:14:14 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Following Hyperlinks with cgi
Message-Id: <399EA446.1C26562A@stomp.stomp.tokyo>
Jeremiah Adams wrote:
> Godzilla! wrote in message
> > I am curious though. If you already have a link to a
> > site, couldn't you discover what is there by following
> > this link via your browser? This is faster and certainly
> > more efficient than using Perl for this task.
> Here's the deal. The script will be posting the same information to several
> cgi scripts hosted on other servers, run by other companies. I just want to
> post the information too all the sites at once and check the returned html
> for certain text. That way I can code some error handleing in case the
> hosts have changed the parameters for the posts to thier scripts.
I see. So you are changing your parameters. This is
not the same situation as described in your orginal
article. What you state here is an entirely different
issue compared to your original post, requiring an
equally different answer.
Your original article requires resolution of a single
link which is better performed via your browser. This
article requires checking for successful return data
from a post action, which is quite different than
resolving a link.
Usually you will receive better information if you
state your parameters clearly and concisely initially.
Godzilla!
------------------------------
Date: Sat, 19 Aug 2000 16:49:08 GMT
From: "Jeremiah Adams" <adams1015@worldnet.att.net>
Subject: Re: Following Hyperlinks with cgi
Message-Id: <8Uyn5.2873$%O6.166432@bgtnsc05-news.ops.worldnet.att.net>
Godzilla! > wrote in message
> Jeremiah Adams wrote:
>
>
> I see. So you are changing your parameters.
no, the sites I will be posting to *might* change thier parameters. I just
want to throw an error if they do. So I can make changes to the flat file
containing the urls. In other words, I don't want the script to fail for
weeks without me knowing and without having to refer to an error log spammed
full of garbage from several hundred other users.
>This is
> not the same situation as described in your orginal
> article. What you state here is an entirely different
> issue compared to your original post, requiring an
> equally different answer.
not true, I do need to follow hyper links that are in a string.
%site_hash = (
link1->http://search.com/cgi-bin/search.cgi?keyword=foo&cmd=bar
link2->http://whatever.com/cgi-bin/search.cgi?keyword=bar&cmd=2&frames=no
);
etc..
> Your original article requires resolution of a single
> link which is better performed via your browser.
if I can do it with one I can do it with 100
>This
> article requires checking for successful return data
> from a post action, which is quite different than
> resolving a link.
> Usually you will receive better information if you
> state your parameters clearly and concisely initially.
So where's the answer?
jeremiah
------------------------------
Date: Sat, 19 Aug 2000 17:37:37 GMT
From: Zacarias <zacarias@teleline.es>
Subject: GD.pm problems, can't install and I need it
Message-Id: <0lvMNk83rDTyXKI9SdbJgaM12dWf@4ax.com>
I need to use GD.pm, it's not installed on my
server. I have a paid webhosting account (server
shared with other users)
Tech support on my webhosting company say "we
don't install custom perl modules, sorry"
And I need GD.pm working. Any ideas?
I tried to upload GD.pm to the same directory
of my program (/cgi-bin/graphgenerator/)
and add that directory to the search path
but it does not work.
Any ideas?
This is off-topic but I can't find a suitable
group for this question.
I have the same problem with GD for PHP3 on
the same server.
------------------------------
Date: 19 Aug 2000 14:02:23 -0400
From: Jordan Katz <katz@underlevel.net>
Subject: Re: GD.pm problems, can't install and I need it
Message-Id: <m3bsypqgcw.fsf@underlevel.underlevel.net>
Zacarias <zacarias@teleline.es> writes:
> I need to use GD.pm, it's not installed on my
> server. I have a paid webhosting account (server
> shared with other users)
>
> Tech support on my webhosting company say "we
> don't install custom perl modules, sorry"
>
> And I need GD.pm working. Any ideas?
>
> I tried to upload GD.pm to the same directory
> of my program (/cgi-bin/graphgenerator/)
> and add that directory to the search path
> but it does not work.
That's not going to work, mainly because that's not how you install
modules, and because GD.pm needs libgd (which your host probably
doesn't have either.)
> Any ideas?
> This is off-topic but I can't find a suitable
> group for this question.
You can switch to webhost that installed all of CPAN (do those even
exist?) or host your site on your own machine with GD.pm properly
installed. Other than that, I don't see what you can do.
> I have the same problem with GD for PHP3 on
> the same server.
PHP should be installed on every decent webhost. Consider switching.
--
Jordan Katz <katz@underlevel.net>
------------------------------
Date: 19 Aug 2000 13:55:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: help foreach doesn't work
Message-Id: <slrn8pt4cl.tj3.abigail@alexandra.foad.org>
Larry Rosler (lr@hpl.hp.com) wrote on MMDXLV September MCMXCIII in
<URL:news:MPG.1407c636ea55120b98aca1@nntp.hpl.hp.com>:
<> [Rearranged and snipped for logical coherence and relevance.]
<>
<> In article <8nl0dr$kef$1@nnrp1.deja.com>, j355@my-deja.com says...
<> > In article <8nkjdr$6d1$1@nnrp1.deja.com>,
<> > cornelhughes@netscape.net wrote:
<>
<> ...
<>
<> > > foreach $week (@week) {
<>
<> > Not only is @week empty, but don't you need to assign the scaler,
<> > $week, to a name other than the @week array?
<>
<> No, it is OK, because $week has no relation whatever to @week.
Unless they are package variables, and you start messing with C<*week>,
or (oh horrors), C<reset 'w'>.
Abigail
--
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'
------------------------------
Date: 19 Aug 2000 15:00:17 GMT
From: mgjv@martien.heliotrope.home (Martien Verbruggen)
Subject: Re: help foreach doesn't work
Message-Id: <slrn8pt6fm.n7v.mgjv@martien.heliotrope.home>
On 19 Aug 2000 13:55:08 GMT,
Abigail <abigail@foad.org> wrote:
> Larry Rosler (lr@hpl.hp.com) wrote on MMDXLV September MCMXCIII in
> <URL:news:MPG.1407c636ea55120b98aca1@nntp.hpl.hp.com>:
> <>
> <> No, it is OK, because $week has no relation whatever to @week.
>
> Unless they are package variables, and you start messing with C<*week>,
> or (oh horrors), C<reset 'w'>.
Now you've done it. Everyone who already knew this will only shake their
head, but everyone who didn't know will want to try it.
Prepare for the onslaught of questions along the line of 'I have this
wwwboard script here (downloaded it because it was mentioned on this
group). Because of something Abigail said I changed all occurences of
$var and @var to *var.. Now it doesn't work anymore. What do I do?'
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing
Interactive Media Division | down all the noises the baby makes so
Commercial Dynamics Pty. Ltd. | later I can ask him what he meant -
NSW, Australia | Steven Wright
------------------------------
Date: Sat, 19 Aug 2000 17:41:46 GMT
From: j355@my-deja.com
Subject: Re: help foreach doesn't work
Message-Id: <8nmgso$6of$1@nnrp1.deja.com>
Yep, you are correct. I had forgotten that, until you reminded me!
Thanks.
In article <slrn8psbsv.n7v.mgjv@martien.heliotrope.home>,
mgjv@tradingpost.com.au wrote:
> [Reordered mail to respect the more natural arrow of time]
>
> On Sat, 19 Aug 2000 03:54:42 GMT,
> j355@my-deja.com <j355@my-deja.com> wrote:
> > In article <8nkjdr$6d1$1@nnrp1.deja.com>,
> > cornelhughes@netscape.net wrote:
> > > I am new to perl and trying to figure out why the following code
won't
> > > work? Why doesn't the following code print "Why Don't you work";
> > >
> > > # determine which week to display, creates var- schedweek
> > > $indx = 0;
> > > $schedweek = 0;
> > > foreach $week (@week) {
> [snip]
> >
> > Not only is @week empty, but don't you need to assign the scaler,
> > $week, to a name other than the @week array?
>
> What makes you say that? What do you think 'foreach' does?
>
> # perl -w
> @week = (1..10);
> foreach $week (@week)
> {
> print "$week ";
> }
> print "\n";
> __END__
>
> What do you think the above prints?
>
> Or are you confused about the fact that @week and $week have the same
> last 4 characters? That's perfectly legal in Perl. $week, %week and
> @week are different thingies.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division |
> Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
> NSW, Australia |
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4066
**************************************