[15777] in Perl-Users-Digest
Perl-Users Digest, Issue: 3190 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 28 18:10:36 2000
Date: Sun, 28 May 2000 15:10:24 -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: <959551824-v9-i3190@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 28 May 2000 Volume: 9 Number: 3190
Today's topics:
How to access documents on other servers? <johnson@siukeung.com>
Re: How to access documents on other servers? <dave@dave.org.uk>
Re: How to access documents on other servers? <johnson@siukeung.com>
Re: How to access documents on other servers? <dave@dave.org.uk>
how to convert Unix (enter key space) back to Windows? <nada818s@hotmail.com>
Re: how to convert Unix (enter key space) back to Windo <elaine@chaos.wustl.edu>
Is using hashes (hashish?) the right approach? <hftig@tninet.se>
Re: Is using hashes (hashish?) the right approach? (Tad McClellan)
Looking for a script <manelgv@teleline.es>
Re: Looking for a script (Tad McClellan)
LWP::UA and https msanderso@hotmail.com
Re: LWP::UA and https <gisle@ActiveState.com>
Re: LWP::UserAgent question (J. B. Moreno)
Re: LWP::UserAgent question <gellyfish@gellyfish.com>
Re: LWP::UserAgent question (J. B. Moreno)
Re: MySQL problem: $DBI::errstr always null <steira@gmx.at>
Re: MySQL problem: $DBI::errstr always null jsunden@my-deja.com
Newbie: Woohoo!!! <y-o-y@home.com>
perl cgi script? <lino@catucci.org>
Perl function processing SQL scripts - all at once or o <dkarr1@san.rr.com>
Re: Perl function processing SQL scripts - all at once <bwalton@rochester.rr.com>
Re: Perl sockets and binary data <gellyfish@gellyfish.com>
Re: Perl unusable as a programming language <epa98@doc.ic.ac.uk>
Re: Perl unusable as a programming language <ariels@compugen.co.il>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 29 May 2000 00:32:44 +0800
From: "Johnson Lau" <johnson@siukeung.com>
Subject: How to access documents on other servers?
Message-Id: <8grhnv$da36@imsp212.netvigator.com>
I can't install LWP module on my web server.
How can I get documents on other servers by using socket or other methods?
Since I know nothing about socket,
please include the script if possible, thank you.
------------------------------
Date: Sun, 28 May 2000 17:59:30 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: How to access documents on other servers?
Message-Id: <bmj2jscjrbck85htdcea7g6pvvujqouca4@4ax.com>
On Mon, 29 May 2000 00:32:44 +0800, "Johnson Lau"
<johnson@siukeung.com> wrote:
>I can't install LWP module on my web server.
>How can I get documents on other servers by using socket or other methods?
>Since I know nothing about socket,
>please include the script if possible, thank you.
Why can't you install LWP on your web server? You do know that
LWP::Simple is a pure Perl module and as such you can "install" it
simply by copying the file Simpe.pm into a directory called LWP
somewhere on your @INC path (hint: "." is usually on your path so put
it in your cgi-bin directory).
If, for some reason, you _really_ can't do that. Then why not take a
look at the code within the LWP modules that you want to use, "borrow"
that code and put it in your own modules.
Actually, that last suggestion could be rephrased as a reason to get
your sysadmins to install the LWP (or any other) modules for you. The
argument goes something like this:
"i'd _really_ like to access web documents on other servers. I kow
that there are well used and tested modules in CPAN to do it which
have been used by thousands of people for some years - do you think
you could install them for me. If you don't, I might have to
reimplement the functionality using my own code... I'm _fairly_ sure I
know how it works..."
hth,
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Mon, 29 May 2000 04:54:26 +0800
From: "Johnson Lau" <johnson@siukeung.com>
Subject: Re: How to access documents on other servers?
Message-Id: <8gs125$l8h$1@justice.csc.cuhk.edu.hk>
"Dave Cross" <dave@dave.org.uk> wrote in message news:bmj2jscjrbck85htdcea7g6pvvujqouca4@4ax.com...
> On Mon, 29 May 2000 00:32:44 +0800, "Johnson Lau"
> <johnson@siukeung.com> wrote:
>
> >I can't install LWP module on my web server.
> >How can I get documents on other servers by using socket or other methods?
> >Since I know nothing about socket,
> >please include the script if possible, thank you.
>
> Why can't you install LWP on your web server? You do know that
> LWP::Simple is a pure Perl module and as such you can "install" it
> simply by copying the file Simpe.pm into a directory called LWP
> somewhere on your @INC path (hint: "." is usually on your path so put
> it in your cgi-bin directory).
>
That means I can use the module without using telnet?
The readme file of the LWP module tells me to do something like this:
perl Makefile.PL
make
make test
make install
However, I can only access the server through FTP.
------------------------------
Date: Sun, 28 May 2000 22:25:04 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: How to access documents on other servers?
Message-Id: <mi33jsg7bilheig3434ssfcpjr4t5kqv26@4ax.com>
On Mon, 29 May 2000 04:54:26 +0800, "Johnson Lau"
<johnson@siukeung.com> wrote:
>
>"Dave Cross" <dave@dave.org.uk> wrote in message news:bmj2jscjrbck85htdcea7g6pvvujqouca4@4ax.com...
>> On Mon, 29 May 2000 00:32:44 +0800, "Johnson Lau"
>> <johnson@siukeung.com> wrote:
>>
>> >I can't install LWP module on my web server.
>> >How can I get documents on other servers by using socket or other methods?
>> >Since I know nothing about socket,
>> >please include the script if possible, thank you.
>>
>> Why can't you install LWP on your web server? You do know that
>> LWP::Simple is a pure Perl module and as such you can "install" it
>> simply by copying the file Simpe.pm into a directory called LWP
>> somewhere on your @INC path (hint: "." is usually on your path so put
>> it in your cgi-bin directory).
>>
>
>That means I can use the module without using telnet?
Yep.
>The readme file of the LWP module tells me to do something like this:
> perl Makefile.PL
> make
> make test
> make install
>However, I can only access the server through FTP.
Well, that is the best way to install Perl modules and as I said in my
previous post it's worth trying to persuade your sysadmins to do that.
But if you can't then, yes, you can just FTP the module file into the
relevant place and it should all work.
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Sun, 28 May 2000 22:53:05 +1000
From: "nada818s" <nada818s@hotmail.com>
Subject: how to convert Unix (enter key space) back to Windows?
Message-Id: <39311557@grissom>
how to convert Unix (enter key space) back to Windows? I got a lot of perl
code have to print out at school but they only have windows machine. My perl
code appear just a long line. Go to every block press enter, just too
troublesome. I use mcopy -t convert windows to linux, is there anyway like
that to convert it back to windows...
nada818s
------------------------------
Date: Sun, 28 May 2000 15:39:35 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: how to convert Unix (enter key space) back to Windows?
Message-Id: <B556B5F7.4F16%elaine@chaos.wustl.edu>
in article 39311557@grissom, nada818s at nada818s@hotmail.com quoth:
> how to convert Unix (enter key space) back to Windows? I got a lot of perl
> code have to print out at school but they only have windows machine. My perl
> code appear just a long line. Go to every block press enter, just too
> troublesome. I use mcopy -t convert windows to linux, is there anyway like
> that to convert it back to windows...
perl -pi.foo -e 's/$/\r/' <yourfilenamehere>
or with awk
awk 'sub("$", "\r")' unixfile.txt > dosfile.txt
or
on SunOS you have unix2dos and dos2unix.
e.
------------------------------
Date: Sun, 28 May 2000 12:27:57 +0200
From: "haftig" <hftig@tninet.se>
Subject: Is using hashes (hashish?) the right approach?
Message-Id: <8gqsb5$9ug$1@zingo.tninet.se>
General question hoping to be pointed in the right direction before I go
charging down a blind
alley. I have 2 files A, B : I wish to print the differences between
associated records in them..
the file format looks like this
someuniquename | dataA,dataB,dataC,,,,,,,,,,, |
someotherdatapossiblyofinterest
If I have a match between any "someuniquename" in fileA and
"someuniquename" in
fileB, I wish to print the differences between the
FileA:someuniquename:dataA,B,C
field and the corresponding field in fileB.
so I began here
open(NEW, "<" . "new.db") || die("Can't open new \n");
while (<NEW>){
push @newdb, [ split(/\|/,$_) ];
for $i ( 0 .. $#newdb ) {
$index = $newdb[$i];
$n = @$index - 1;
for $j ( 0 .. $n ) {
print "$newdb[$i][$j]\n";
}
}
}
this doesn't work quite right as it seems to print
i
i
i+1
i
i+1
i+2
Thats ok though - I can play around a bit and figure that out.
I figured this would give me a list a list of elements so I could compare
$newdb[$n] [0] with $olddb[$n][0] and on a match execute some
similar
function by dumping the contents of $olddb[$n][1] (for example) into
another array
Am I barking up the completely wrong tree ?
------------------------------
Date: Sun, 28 May 2000 10:06:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Is using hashes (hashish?) the right approach?
Message-Id: <slrn8j29uo.3cc.tadmc@magna.metronet.com>
On Sun, 28 May 2000 12:27:57 +0200, haftig <hftig@tninet.se> wrote:
>Subject: Is using hashes (hashish?) the right approach?
Yes, using hashes _is_ the right approach.
So why aren't you using any hashes?
>General question hoping to be pointed in the right direction before I go
>charging down a blind
>alley. I have 2 files A, B : I wish to print the differences between
>associated records in them..
I'm looking carefully for your question, and I'm not finding it...
What, exactly, is your question?
What is wrong with my code below?
How can I use hashes instead of arrays?
How can I compare the two files?
>the file format looks like this
>
>someuniquename | dataA,dataB,dataC,,,,,,,,,,, |
>someotherdatapossiblyofinterest
>
>If I have a match between any "someuniquename" in fileA and
>"someuniquename" in
>fileB, I wish to print the differences between the
>FileA:someuniquename:dataA,B,C
>field and the corresponding field in fileB.
>
>so I began here
>
>open(NEW, "<" . "new.db") || die("Can't open new \n");
^^^^^
That is a a strange way of writing it. Most folks would write:
open(NEW, '<new.db') || die...
or even just:
open(NEW, 'new.db') || die...
since open() defaults to opening for input.
You should use single quotes for constant strings.
You should include the name of the file in your diagnostic message.
You should include Perl's $! special variable in your diagnostic message.
open(NEW, 'new.db') || die("Can't open 'new.db' $!");
>while (<NEW>){
> push @newdb, [ split(/\|/,$_) ];
> for $i ( 0 .. $#newdb ) {
print "i=$i\n"; # this might explain the output
You are walking through @newdb _for every line_.
One loop iteration for the first line.
Two loop iterations for the second line (repeating one).
Three loop iterations for the third line (repeating two)...
> $index = $newdb[$i];
> $n = @$index - 1;
> for $j ( 0 .. $n ) {
That is a convoluted way of walking the second level indexes.
You can replace 3 lines and eliminate 2 temporary variables:
for $j ( 0 .. $#{$newdb[$i]} ) {
You could also just use the Data::Dumper module to see what
you have in @newdb.
> print "$newdb[$i][$j]\n";
> }
> }
> }
>
>this doesn't work quite right as it seems to print
>i
>i
>i+1
>i
>i+1
>i+2
>
>Thats ok though - I can play around a bit and figure that out.
You have your loops nested funny (i.e. a logic error).
>I figured this would give me a list a list of elements so I could compare
>
>$newdb[$n] [0] with $olddb[$n][0] and on a match execute some
>similar
>function by dumping the contents of $olddb[$n][1] (for example) into
>another array
>
>
>Am I barking up the completely wrong tree ?
Yes (because you are using arrays instead of hashes).
No (because you seem to think you should be using hashes).
:-)
You should review the standard docs for multilevel data
structures ( perlref, perllol, perldsc ).
Here is how I would do it, using a HoL (hash of lists):
-----------------------------------
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
my %newdb;
while (<DATA>){ # collect the data
chomp;
my($key, @fields) = split /\|/;
$newdb{$key} = \@fields;
}
foreach my $id ( sort keys %newdb ) { # output the data
print "$id:\n";
foreach my $i ( 0 .. $#{$newdb{$id}} ) {
print " $i: $newdb{$id}[$i]\n";
}
}
print Dumper \%newdb;
__DATA__
one|One|1
two|Two|2
three|Three|3
-----------------------------------
output:
one:
0: One
1: 1
three:
0: Three
1: 3
two:
0: Two
1: 2
$VAR1 = {
'one' => [
'One',
'1'
],
'three' => [
'Three',
'3'
],
'two' => [
'Two',
'2'
]
};
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 28 May 2000 14:10:44 GMT
From: "Manel" <manelgv@teleline.es>
Subject: Looking for a script
Message-Id: <EN9Y4.8299$K4.51593@telenews.teleline.es>
Hi newsusers.
I'm looking for a script to create a job center.
If anybody knoks about it please send an email to webmaster@fotowebs.com
Thanks
------------------------------
Date: Sun, 28 May 2000 10:52:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Looking for a script
Message-Id: <slrn8j2cls.3s7.tadmc@magna.metronet.com>
On Sun, 28 May 2000 14:10:44 GMT, Manel <manelgv@teleline.es> wrote:
>I'm looking for a script to create a job center.
Newsgroups are not search engines.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 28 May 2000 04:12:13 GMT
From: msanderso@hotmail.com
Subject: LWP::UA and https
Message-Id: <8gq6al$jc$1@nnrp1.deja.com>
I'm attempting to use LWP::UserAgent and HTTP::Cookies in a script that
I'm writing. I'm using it to access a site with SSL [on apache].
I got some code that looks something like this:
shebang
Use LWP::UserAgent;
use HTTP::Cookies;
$data="name=name&pass=password";
$ua=LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new(file=>"filename.txt", autosave=>1));
my $req=new HTTP::Request Post =>
"https://mysite.com/cgi-bin/script.pl";
$req->conent("$data");
my $res=$ua->request($req);
blahblahblah
When I examine the cookiefile, all I see is #LWP-Cookies-1.0;
However, if I print $res->as_string, I can see the complete cookie in
the header file.
Why won't it write out??
tia
msa
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 28 May 2000 19:45:22 +0200
From: Gisle Aas <gisle@ActiveState.com>
Subject: Re: LWP::UA and https
Message-Id: <m3ln0uh8lp.fsf@eik.g.aas.no>
msanderso@hotmail.com writes:
> I'm attempting to use LWP::UserAgent and HTTP::Cookies in a script that
> I'm writing. I'm using it to access a site with SSL [on apache].
>
> I got some code that looks something like this:
>
> shebang
> Use LWP::UserAgent;
> use HTTP::Cookies;
>
> $data="name=name&pass=password";
> $ua=LWP::UserAgent->new;
> $ua->cookie_jar(HTTP::Cookies->new(file=>"filename.txt", autosave=>1));
> my $req=new HTTP::Request Post =>
> "https://mysite.com/cgi-bin/script.pl";
> $req->conent("$data");
> my $res=$ua->request($req);
>
> blahblahblah
>
> When I examine the cookiefile, all I see is #LWP-Cookies-1.0;
>
> However, if I print $res->as_string, I can see the complete cookie in
> the header file.
>
> Why won't it write out??
What does the Set-Cookie look like?
--
Gisle Aas
------------------------------
Date: Sun, 28 May 2000 03:11:40 -0400
From: planb@newsreaders.com (J. B. Moreno)
Subject: Re: LWP::UserAgent question
Message-Id: <1ebbg9n.1pa3zdr159tp9eN%planb@newsreaders.com>
Carlos Ramirez <cramirez@gte.net> wrote:
> "J. B. Moreno" wrote:
>
> > Isn't UserAgent supposed to allow using FTP?
> >
> > I've got a simple script to grab a file from a remote location, and it's
> > successfully worked with an http "get", but when I change the url so
> > that ftp is supposed to be used, it fails (as far as I can tell it
> > doesn't even attempt to make a connection).
> >
-snip-
> > # send request and get response
> > my $req = new HTTP::Request 'GET' => $page;
> > my $res = $ua->request($req, $save_file);
> >
> Try using the Net::FTP module
That's certainly one possibility, but unless it's required (i.e.
UserAgent doesn't work) then it's not what I'd prefer to do. The above
is simple and straightforward, and except for the fact that it's not
working with FTP does just what I want: get a remote file and save it
locally, quickly and simply.
It probably wouldn't be that hard to write the same thing use Net::FTP,
but unless there's a reason to go with the quick and dirty solution I
prefer to do things right. And if UserAgent supports FTP (and it does
according to my reading of the [1]docs) then that's the clearer and
better solution.
[1] UserAgent.pm says: The basic approach of the library is to use HTTP
style communication for all protocol schemes, i.e. you will receive an
HTTP::Response object also for gopher or ftp requests. In order to
achieve even more similarities with HTTP style communications, gopher
menus and file directories will be converted to HTML documents.
--
John B. Moreno
------------------------------
Date: 28 May 2000 01:29:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: LWP::UserAgent question
Message-Id: <8gpp9h$15a$1@orpheus.gellyfish.com>
On Sat, 27 May 2000 01:26:23 -0400 J. B. Moreno wrote:
> Isn't UserAgent supposed to allow using FTP?
>
> I've got a simple script to grab a file from a remote location, and it's
> successfully worked with an http "get", but when I change the url so
> that ftp is supposed to be used, it fails (as far as I can tell it
> doesn't even attempt to make a connection).
Thats wierd - it works for me. What do you get it you print
$res->status_line ?
/J\
--
You never know when an old calendar might come in handy. Sure, it's not
1985 right now, but who knows what tommorow will bring. And these TV
Guides, so many memories. Gomer upset's Sgt. Carter. I'll never forget
that episode.
--
fortune oscar homer
------------------------------
Date: Sun, 28 May 2000 17:24:25 -0400
From: planb@newsreaders.com (J. B. Moreno)
Subject: Re: LWP::UserAgent question
Message-Id: <1ebcqug.1gf5l8or8ly6tN%planb@newsreaders.com>
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Sat, 27 May 2000 01:26:23 -0400 J. B. Moreno wrote:
> > Isn't UserAgent supposed to allow using FTP?
> >
> > I've got a simple script to grab a file from a remote location, and it's
> > successfully worked with an http "get", but when I change the url so
> > that ftp is supposed to be used, it fails (as far as I can tell it
> > doesn't even attempt to make a connection).
>
> Thats wierd - it works for me. What do you get it you print
> $res->status_line ?
Well, that probably explains my problem.
On my mac I get:
500 # Net::FTP 2 required--this is only version 1.01
File 'Programming:MacPerl:lib:LWP:Protocol:ftp.pm'; Line 23
And on the server I get:
500 Can't locate Net/FTP.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.00503/i386-bsdos /usr/local/lib/perl5/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-bsdos
/usr/local/lib/perl5/site_perl/5.005 .) at
/usr/local/lib/perl5/site_perl/5.005/LWP/Protocol/ftp.pm line 22.
So it looks like locally I need to upgrade Net:FTP and on the server I
need to have it installed.
Thanks.
--
John B. Moreno
------------------------------
Date: Sun, 28 May 2000 09:29:28 +0200
From: steira <steira@gmx.at>
Subject: Re: MySQL problem: $DBI::errstr always null
Message-Id: <3930CAD8.2C436F5D@gmx.at>
try this:
unless ($$DBH = DBI->connect($DSN, $UID, $PWD, {PrintError => 1},)) {
return "Error:$DBI::errstr";
}
jlamport@calarts.edu wrote:
>
> So I'm using the DBI module to access a MySQL database. Everything seems
> to work fine, EXCEPT, contrary to the documentation, $DBI::err and
> $DBI::errstr are always undefined, even immediately after executing a bad
> SQL query. This is true whether I access these values as $DBI::errstr or
> as $db_handle->errstr. Setting
>
> $db_handle->{PrintError} = 1;
>
> causes the errors to get printed to STDERR as expected -- they're just
> not showing up in $DBI::errstr or $DBI::err.
>
> I suppose as a workaround I could wrap my $statement_handle->execute()
> calls in an eval block, and capture the errors that way, but that seems
> like a rather inelegant solution, when simply checking $DBI::errstr *
> ought* to do what needs to be done.
>
> Any ideas what could be going wrong? Or is my documentation faulty, and
> $DBI::errstr doesn't really do what I expect it to? (I'm going by the
> O'Reilly book "MySQL & mSQL".)
>
> -jason
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sun, 28 May 2000 19:58:33 GMT
From: jsunden@my-deja.com
Subject: Re: MySQL problem: $DBI::errstr always null
Message-Id: <8grtp2$4ho$1@nnrp1.deja.com>
Try omitting the $-sign and write DBI->errstr instead. Then it should
work -- it does for me when I use it like this:
$sth->execute or die "Something went wrong: ", DBI->errstr;
/Joakim Sundén
In article <8go533$mq8$1@nnrp1.deja.com>,
jlamport@calarts.edu wrote:
> So I'm using the DBI module to access a MySQL database. Everything
seems
> to work fine, EXCEPT, contrary to the documentation, $DBI::err and
> $DBI::errstr are always undefined, even immediately after executing a
bad
> SQL query. This is true whether I access these values as
$DBI::errstr or
> as $db_handle->errstr. Setting
>
> $db_handle->{PrintError} = 1;
>
> causes the errors to get printed to STDERR as expected -- they're just
> not showing up in $DBI::errstr or $DBI::err.
>
> I suppose as a workaround I could wrap my $statement_handle->execute()
> calls in an eval block, and capture the errors that way, but that
seems
> like a rather inelegant solution, when simply checking $DBI::errstr *
> ought* to do what needs to be done.
>
> Any ideas what could be going wrong? Or is my documentation faulty,
and
> $DBI::errstr doesn't really do what I expect it to? (I'm going by the
> O'Reilly book "MySQL & mSQL".)
>
> -jason
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 28 May 2000 21:12:58 GMT
From: Andy <y-o-y@home.com>
Subject: Newbie: Woohoo!!!
Message-Id: <uZfY4.213744$Tn4.1921868@news1.rdc2.pa.home.com>
In a blind flash of comprehension, S_ now makes sense!!! Big advances
now that that's behind me.
WOOHOO!!!
LOL!
Geez...
Andy
------------------------------
Date: Sun, 28 May 2000 20:00:14 +0200
From: Lino Catucci <lino@catucci.org>
Subject: perl cgi script?
Message-Id: <39315EAE.5303A6C7@catucci.org>
Hello everybody,
I hope you can help me with the following script.
I have a Linux RedHat 6.1 machine and it is working as a pop3/smtp
e-mail
server and as a Apache webserver for around 300 users.
Now i want to give the users the opportunity to change there Linux/pop3
password via the website by clicking a button.
The users have to provide there username, the old password and twice
there
new password , then they have to click on a button called "change" and
then
there password has to be changed. I want to use a cgi script.
Can you help me with such a script or do you know where to look for such
a
script?
--
-------------------------------------------
Angelo Lino Catucci
mailto:Lino@catucci.org
http://www.catucci.org
ICQ: 5402187
--------------------------------------------
------------------------------
Date: Sun, 28 May 2000 19:18:25 GMT
From: "debra karr" <dkarr1@san.rr.com>
Subject: Perl function processing SQL scripts - all at once or one at a time?
Message-Id: <5ieY4.19424$Y4.93823@typhoon2.san.rr.com>
I have the code written process (right now just print to screen contents) a
user maintained directory by entering, from a command line (script,
path/directory, number of times performed, and a delay).
So far so good. It will evidentually process SQL statements into a DB.
QUESTION: What is normally done.....process all files at once in a batch or
array by opening the directory, reading the directory, then sending the
contents into a DB, running how many loops of this, with/without delay
inbetween if the SQL scripts are written right? Or reading one SQL file at
one time, open DB, process, run loop, run delay, close DB, get next file,
open DB, process, etc., until EOF?
------------------------------
Date: Sun, 28 May 2000 20:02:09 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Perl function processing SQL scripts - all at once or one at a time?
Message-Id: <39317A44.BFDDF2B1@rochester.rr.com>
debra karr wrote:
>
> I have the code written process (right now just print to screen contents) a
> user maintained directory by entering, from a command line (script,
> path/directory, number of times performed, and a delay).
>
> So far so good. It will evidentually process SQL statements into a DB.
> QUESTION: What is normally done.....process all files at once in a batch or
> array by opening the directory, reading the directory, then sending the
> contents into a DB, running how many loops of this, with/without delay
> inbetween if the SQL scripts are written right? Or reading one SQL file at
> one time, open DB, process, run loop, run delay, close DB, get next file,
> open DB, process, etc., until EOF?
And your Perl question is?
--
Bob Walton
------------------------------
Date: 28 May 2000 01:36:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl sockets and binary data
Message-Id: <8gppm6$2eu$1@orpheus.gellyfish.com>
On Sat, 27 May 2000 17:30:03 GMT R1CH wrote:
> Hi,
> I have a bunch of packet data (ie, just binary mess such as
>
> ˆˆ 0
> È‚ F ˆ
> that I need to send down a TCP stream to another computer. However, when
> I use
>
> open (PACKET,"mypacket");
> $packettosend = <PACKET>;
>
> $packettosend is always just the first couple of bytes. This makes me
> think perl is hitting an EOF or some other character in the file and
> stops reading it. I have tried sysread too, same problem. Any ideas?
> Some way of forcing Perl to read all the file as binary and ignore
> special characters?
>
binmode(PACKET);
/J\
--
Operator! Give me the number for 911!
--
fortune oscar homer
------------------------------
Date: 27 May 2000 20:47:02 +0100
From: Edward Avis <epa98@doc.ic.ac.uk>
Subject: Re: Perl unusable as a programming language
Message-Id: <xn9bt1rixmx.fsf@pinga.doc.ic.ac.uk>
Russell Bornschlegel <kaleja@estarcion.com> writes:
>Perl does seem to me to have an advantage over some other languages in that
>there's essentially only one implementation of the core language[1], as
>opposed to countless C++ compilers which all differ from the Standard and
>from each other in different subtle ways.
Are you sure this is an advantage? Does Mac OS have an advantage over
Unix of having only one implementation? I would say that a bit of
competition is healthy.
--
Ed Avis
epa98@doc.ic.ac.uk
------------------------------
Date: 28 May 2000 09:37:38 +0300
From: Ariel Scolnicov <ariels@compugen.co.il>
Subject: Re: Perl unusable as a programming language
Message-Id: <yzqpuq7kwnh.fsf@compugen.co.il>
simon@brecon.co.uk (Simon Cozens) writes:
[...]
> I think Ilya's beef is with the lack of formal definition of the
> language. But I think that's a cool feature. No formal definition
> of the language means Perl is defined by what perl does. Ergo, perl
> is a perfect, bug-free Perl interpreter. :)
[...]
This is actually not quite true. If it were, I could use any dirty
undocumented "happens-to-work-in-my-binary-version" feature of perl
(not Perl), and complain bitterly when Perl 5.6 (or Perl 5.005_04)
comes out and breaks it for me. So if that's how we define Perl (not
perl), we get stuck. On the other hand, if we want to have the
complete list of deprecated features, we must have its complement,
i.e. the Perl language definition.
As usual, we're stuck somewhere in between. I think the hardest
problem is probably understanding the Perl parser (as evidenced by the
fact that some syntactical threads degenerate into reading the source
code, rather than the documentation). The *semantics* of the language
and primitives seem (to me) to cause far fewer problems. In a
Lisp-like language, say, the syntax is trivial, so people go out and
start thinking about the precise semantics.
--
Ariel Scolnicov |"GCAAGAATTGAACTGTAG" | ariels@compugen.co.il
Compugen Ltd. |Tel: +972-2-6795059 (Jerusalem) \ We recycle all our Hz
72 Pinhas Rosen St. |Tel: +972-3-7658514 (Main office)`---------------------
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555 http://3w.compugen.co.il/~ariels
------------------------------
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 3190
**************************************