[15645] in Perl-Users-Digest
Perl-Users Digest, Issue: 3058 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 16 06:05:35 2000
Date: Tue, 16 May 2000 03:05:17 -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: <958471517-v9-i3058@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 16 May 2000 Volume: 9 Number: 3058
Today's topics:
<perl control for GPIB??? (Scott Hicks)
Re: [Hash] Is the key always double-quoted? (Villy Kruse)
Re: _PATH_LOG not defined <gellyfish@gellyfish.com>
accessing files via Perl on SuSe 6.4 <tag@gmx.de>
Re: accessing files via Perl on SuSe 6.4 <phill@modulus.com.au>
Re: Annoying -w messages from standard distributed modu <shouck@bellatlantic.net>
Re: BerkeleyDB3.0.55 <saoconne@gateway.net>
checking the largest number <newbie@aol.com>
Re: checking the largest number <jeff@vpservices.com>
Compress::Zlib jake0641@my-deja.com
Re: creating a complex HoH <nospam@devnull.com>
Re: DBD::ODBC error <aahz@gol.com>
Re: Do YOU use taint-checking? <wall@bacon.ethz.ch>
Filereading into $addresses scalar / simple problem? <webmaster@ostas.lu.se>
Re: Filereading into $addresses scalar / simple problem <phill@modulus.com.au>
Re: Getting words between two strings <phill@modulus.com.au>
Re: Getting words between two strings <godzilla@stomp.stomp.tokyo>
Re: Help with Perl/CGI scripts jake_spoon54@my-deja.com
Re: How do I get a user's home directory with NIS+? <shouck@bellatlantic.net>
Re: How to COPY a website (Csaba Raduly)
Re: How to lock a tie()d file? <phill@modulus.com.au>
Java/Perl lingo stbruno@my-deja.com
Re: Job <gellyfish@gellyfish.com>
Re: make error: missing file separator afay3483@my-deja.com
Re: MS Word to Text help <jeff@vpservices.com>
Re: MS Word to Text help <sigvald.refsum@siemens.no>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 May 2000 20:06:06 GMT
From: shicks@aur.alcatel.com (Scott Hicks)
Subject: <perl control for GPIB???
Message-Id: <8f9r3e$t7d$1@aurwww.aur.alcatel.com>
I am interested in using Perl for control of various telecommunication test equipment via a GPIB interface. Does anyone have experience with this application of Perl? Or can someone point me to a website that can help?
Thanks,
--
--
Scott Hicks
------------------------------
Date: 16 May 2000 08:45:45 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: [Hash] Is the key always double-quoted?
Message-Id: <slrn8i22lc.r56.vek@pharmnl.ohout.pharmapartners.nl>
On 15 May 2000 07:03:24 -0700, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Charles" == Charles Henry <charles.henry@engineer2k.com> writes:
>
>Charles> I read in the Camel Book that the key of a hash was automatically
>Charles> double-quoted.
>
>Most likely you read something similar to that, and concluded what you
>said, because the Camel Book would not spout such an untruth.
>
>There are certain circumstances where a *bareword* (a C symbol
>appearing without quotes) is automatically treated like a *quoted
>bareword*, perhaps with warnings, but nevertheless quoted, even in the
>face of "use strict" (especially "use strict subs") enabled. Around
>hashes, these would be as the key of a hash:
>
Would it be correct to interpret 01 as a octal number and not a
bareword that would be treated as a string between {} or before => ?
It looks like a number, therefore it is a number, or is this wrong?
Villy
------------------------------
Date: 16 May 2000 07:05:30 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: _PATH_LOG not defined
Message-Id: <8fqofa$7g2$1@orpheus.gellyfish.com>
On Sun, 14 May 2000 11:54:24 -0700 Baris wrote:
> I was trying to install DBI on SGI Irix 5.3, and I received an error message
> saying something like this:
> _PATH_LOG is not defined; error in line 277 in Sys/Syslog.pm
>
> If I look at the header file Sys/Syslog.h , I saw that _PATH_LOG is not
> defined in it, on the other hand on my linux machine, it is defined in
> Syslog.h.
> I checked other SGI machines running Irix 6.4 and find out that they have
> the same problem.
> How can I solve this problem?
Patch Syslog.xs, syslog.ph or Syslog.pm so that it does the right thing on
Irix - make sure you submit the patch via perlbug when you have done.
Alternatively you might use perlbug to submit a bug report.
/J\
--
Lisa honey, are you saying you're _never_ going to eat any animal
again? What about bacon?
--
fortune oscar homer
------------------------------
Date: Tue, 16 May 2000 11:17:16 +0200
From: Toni <tag@gmx.de>
Subject: accessing files via Perl on SuSe 6.4
Message-Id: <3921121C.3E51DC20@gmx.de>
Hy, (this might be a little off-topic, but i would appreciate any help)
I'd like to open a file like this
open (FILETHING, "spinach.txt");
but everything my Apache error log tells me, that it can not
open the file. I can even
open (FILETHING, "/usr/local/httpd/cgi-bin/spinach.txt");
and it doesn´t change. And even after chmod´ing everything i can
get hold of to 777 STILL NO CHANGE.....
Where is the misstake ? (Do I need to say that i am a newbie to Linux ?)
Do i have to set any rights for file access in apache config ?
I did not modify anything yet (at least i think so).
It is the default installation that i am using.
Please help me, because i´m already going mehari.....
------------------------------
Date: Tue, 16 May 2000 19:41:49 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: accessing files via Perl on SuSe 6.4
Message-Id: <392117DD.EE2@modulus.com.au>
Toni wrote:
>
> Hy, (this might be a little off-topic, but i would appreciate any help)
> I'd like to open a file like this
> open (FILETHING, "spinach.txt");
>
> but everything my Apache error log tells me, that it can not
> open the file. I can even
> open (FILETHING, "/usr/local/httpd/cgi-bin/spinach.txt");
> and it doesn´t change. And even after chmod´ing everything i can
> get hold of to 777 STILL NO CHANGE.....
>
> Where is the misstake ?
open (FILETHING, "/usr/local/httpd/cgi-bin/spinach.txt") || die "cannot
open your file as $!";
This will get you a useful diagnostic which may guide you to the
problem.
[snip]
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Tue, 16 May 2000 04:59:44 GMT
From: Scott Houck <shouck@bellatlantic.net>
Subject: Re: Annoying -w messages from standard distributed modules
Message-Id: <pgl1issqdtjkm6sr3hu3ae692ied6rrcpj@4ax.com>
Maybe he could do something funky like $^W=0; use BuggyModule; $^W=1;
Tom Phoenix <rootbeer@redcat.com> wrote:
>On Mon, 15 May 2000, John Lin wrote:
>
>> Constant subroutine emptyenum redefined
>> at D:/Perl/site/lib/Win32/OLE/Const.pm line 65535.
>>
>> Hey, D:/Perl/site/lib/Win32/OLE/Const.pm has only 187 lines.
>> Last time I got another error reported at DBD::Oracle line 0.
>> Line 0? Yes.
>
>Hey, every program has a bug. perl is a program. Therefore, Socrates is a
>bug. :-)
>
>> Since the warnings are carped from standard distributed modules,
>> it is inappropriate for us to modify the source code to fix it.
>
>Who says? But when you fix a bug, be sure to send the patch to perlbug.
>
>> Then, can we ask for a -w option that shuts up those carps from
>> other modules we use, and just warn the errors in our own code?
>
>Sure; spell it -Mwarnings . :-)
>
>Cheers!
------------------------------
Date: Tue, 16 May 2000 05:19:41 GMT
From: saoconne <saoconne@gateway.net>
Subject: Re: BerkeleyDB3.0.55
Message-Id: <3920DAC2.777E8D45@gateway.net>
Rob, did you get any resolution to this problem? I am experiencing the
samething on a system that I am trying to build. I am not working with
quite the same levels of software, however, I am getting the same
result...
Any suggestions would be greatly appreciated. Stephen....
Rob wrote:
>
> Howdy All,
>
> Building Perl5.6 on Solaris8/SunUltra/BerkeleyDB and continue to get
> core dumps on make test regarding BerkeleyDB3.0.55 and also failed
> during Perl make test.
>
> Any suggestions welcomed..
> Rob
> -----------
>
> make test
> PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib
> -I/usr/local/lib/perl5/5.6.0/sun4-solaris -I/usr/local/lib/perl5/5.6.0
> -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests
> @ARGV;' t/*.t
> t/btree.............dubious
>
> Test returned status 0 (wstat 138, 0x8a)
> test program seems to have generated a core
> t/destroy...........dubious
>
> Test returned status 0 (wstat 138, 0x8a)
> test program seems to have generated a core
------------------------------
Date: Tue, 16 May 2000 00:53:32 -0700
From: newbie <newbie@aol.com>
Subject: checking the largest number
Message-Id: <3920FE7B.F4A4BEF9@aol.com>
I've got a part of a script that opens an HTML page and looks for a set
of lines with numbers in them. Like
starts the same 3
starts the same 2
starts the same 7
How can I search for the lines that start the same and determine which
line has the largest number? Then be able to print that number.
------------------------------
Date: Mon, 15 May 2000 23:13:11 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: checking the largest number
Message-Id: <3920E6F7.D0286BD8@vpservices.com>
newbie wrote:
>
> I've got a part of a script that opens an HTML page and looks for a set
> of lines with numbers in them. Like
> starts the same 3
> starts the same 2
> starts the same 7
>
> How can I search for the lines that start the same and determine which
> line has the largest number? Then be able to print that number.
You haven't told us if "starts the same" has the possiblity of having
any numbers in it, let's assume it does not. You haven't told us
whether the numbers you are looking for are digits, whole numbers,
floating point numbers, or what. Let's assume they are whole numbers.
Given those assumptions:
my $highest =0;
while(<DATA>) {
if( /starts the same (\d*)/ ) {
$highest = $1 if $1 > $highest;
}
}
print "[$highest]";
--
Jeff
------------------------------
Date: Tue, 16 May 2000 07:19:05 GMT
From: jake0641@my-deja.com
Subject: Compress::Zlib
Message-Id: <8fqsov$anl$1@nnrp1.deja.com>
I have been trying to read a .gz file. I read the
docs for Compress::Zlib on CPAN. I just want to
decompress the whole file and then parse it.
(Access logs, the rest of the program works for
the uncompressed new files, but simple open on
the .gz files returns "garbage"). I am trying to
use the $dest=compress($source) function, but I
keep getting undef for $dest. The explanation for
using this function is a bit skimpy -- The source
buffer can either be a scalar or a scalar
reference.--
What I was trying-
use Compress::Zlib;
open(ZFILE, "access_log.1.gz") or die "problem:
$!";
my $zfile=<ZFILE>; #assuming no line breaks
in .gz files?
close ZFILE;
my $uzfile=uncompress($zfile);
print $uzfile;
This doesn't produce an error, but prints
nothing. The file is there, and I can uncompress
it on the command line. (Of course, I want to
automate this with my program.)
I also tried the gzopen command following the
docs, but I couldn't get what I wanted out of
that either. This is going to be a CGI script,
and although it won't (shouldn't, but nothing's
totally secure) be used by the general public, I
want to avoid sys calls and the like. I found the
following response to a similar question:
>
>It might be more convenient to open
>RAWDATA, "gzip -dc '$filename' |" or die "can't
>open pipe on $filename: $!".
Is this safe for CGI? Am I just doing something
wrong with the uncompress($source) function?
Thanks in advance,
Jake
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 May 2000 04:29:14 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: creating a complex HoH
Message-Id: <8fqiqq$nuh$1@216.155.32.110>
In article <slrn8hu5cv.541.eric@plum.fruitcom.com>, eric@fruitcom.com wrote:
| I am using a reference to a hash in $bundle but only becuase I believe that
| may be more efficient. A plain %hash would be fine.
|
| A longer question (possibly) would be how to create the following structure
| while looping though input. I am used to creating HoH structures where the
| HoH at each level has only a single key but cannot figure how to build this
| type of stucture withmultiple keys in certain places. Tried perldsc and
| perllol but am out of my depth :( . Finding I could achieve the above gave
| me the confidence to build a looping routine for the structure below, only
| to realise that creating the structure itself is not so straight forward (to
| be anyway).
|
seach back in DejaNews for a three-item thread of mine entitled
" Re: MUCH better DATA file formatting :) (THANK YOU) "
References: <8fd8on$jce$0@216.155.32.24> <8fdmhh$ke2$0@216.155.32.24>
<8ff9br$m0g$0@216.155.32.166>
wherein I built a complex hash of hash of hash of array and built the
datastructure in reverse, and then put together the file bits that would create
this HoHoHoL from a datafile.
the SINGLE MOST important considerations when doing this is the ordering of the
data.. HOW do you want the structure to build, what is the SIMPLEST structure it
could posess, and MAKE DAMN sure that you can extract the data easily should you
need only segments of it.
HtH! :)
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Tue, 16 May 2000 08:02:29 GMT
From: "Chris Williams" <aahz@gol.com>
Subject: Re: DBD::ODBC error
Message-Id: <pg7U4.1662$uL2.113648@nnrp.gol.com>
That worked, thank you.
"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:39201EAF.DE85AE54@vpservices.com...
> Markus Enders wrote:
> >
> > Hi Chris,
> >
> > Chris Williams wrote:
> >
> > > my $dbh = DBI->connect("dbi:ODBC:driver=Microsoft Access Driver
> > > (*.mdb);dbq=\\\\A\\Test.mdb");
> >
> > ODBC is an interface which gives you access to different data sources.
> > Which data sources can be accessed if defined in the ODBC-panel on your
> > computer (at least on NT, - probably it's the same on Win2K).
> > You give a name to each data source. The name of the data source is,
> > what you must specify here. Not the use of the Access Driver. This is
> > done in the ODBC panel.
>
> Sorry, Markus, but you're only half right here. Giving a named DSN in
> the ODBC panel is *one* way to connect via DBD::ODBC, but it is also
> quite possible to use what is called a DSN-less connection in which all
> information is specified in the DBI connect string and there is no
> corresponding DSN name in the ODBC panel. I have used such DSN-less
> connections with excel and with the Jet text drivers. I have read that
> it is possible to do them with Access but haven't tried it myself.
> Basically the dang things are *very* picky and none quite like the
> next. Some seem to require backslashes rather than forward slashes,
> some have curly braces around the driver name, etc. The best source of
> info on the DSN-less connections is written for ADO but works quite well
> for DBD::ODBC --
>
> http://www.able-consulting.com/ADO_Conn.htm
>
> Chris, I think you are missing curly braces, it should be:
>
> my $dsn = q[Driver={Microsoft Access Driver (*.mdb)};]
> . q[Dbq=a:\Test.mdb];
> my $dbh = DBI->connect("dbi:ODBC:$dsn",$user,$passwd,$attrbs);
>
> --
> Jeff
------------------------------
Date: 16 May 2000 12:03:49 +0200
From: Ernst-Udo Wallenborn <wall@bacon.ethz.ch>
Subject: Re: Do YOU use taint-checking?
Message-Id: <uipuqmyfp6.fsf@bacon.ethz.ch>
webqueen, queen of the web <webqueen@my-deja.com> writes:
> So, again, are YOU a taint-checker?
Yes. In ad-hoc scripts of course not, but in everything
i deliver. I even use it as kind of a syntax checker
(which in a way it is), to make sure an integer
stored in a temp file is really an integer when i
read it in and stuff like that.
BTW, is there a site on the net with 'Popular regexps/methods
for untainting xyz'? where xyz is an url, a filename, and such?
I found abigails url-regexp (way cool) but that's the closest
thing to a canonical untaint-list.
--
Ernst-Udo Wallenborn
Laboratorium fuer Physikalische Chemie
ETH Zuerich
------------------------------
Date: Mon, 15 May 2000 18:00:11 +0200
From: Jimmy Lantz <webmaster@ostas.lu.se>
To: Forum Macperl <macperl-forum@macperl.org>, Web Macperl <macperl-webcgi@macperl.org>
Subject: Filereading into $addresses scalar / simple problem?
Message-Id: <39201F0B.3DBB9E7D@ostas.lu.se>
Hi I'm using the Mail::Sendmail program and I'm trying to take
emailaddresses from a textfile (see below)
But it wont work, Any ideas??
It says there's no recipent.
Pls help me.
Jimmy Lantz
$meddelande ="Hello and goodbye";
$amne ="Hello and goodbye";
############################
#Make Mail
use Mail::Sendmail;
%mail = ( Bcc => "$bcc", From =>
'webmaster@ostas.lu.se', Message => "$meddelande",
Subject => "$amne"
);
sendmail(%mail) or die $Mail::Sendmail::error;
&do_reply;
exit;
sub do_bcc
{
open(INFO, $datafil);
@lines = <INFO>;
close(INFO);
$bcc = @lines;
}
###############The datafile contents##########
webmaster@ostas.lu.se,
webmaster@ostas.lu.se,
webmaster@ostas.lu.se,
webmaster@ostas.lu.se,
------------------------------
Date: Tue, 16 May 2000 15:52:55 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Filereading into $addresses scalar / simple problem?
Message-Id: <3920E237.7C2@modulus.com.au>
Jimmy Lantz wrote:
>
> Hi I'm using the Mail::Sendmail program and I'm trying to take
> emailaddresses from a textfile (see below)
> But it wont work, Any ideas??
> It says there's no recipent.
>
> Pls help me.
> Jimmy Lantz
>
> $meddelande ="Hello and goodbye";
> $amne ="Hello and goodbye";
> ############################
> #Make Mail
> use Mail::Sendmail;
> %mail = ( Bcc => "$bcc", From =>
> 'webmaster@ostas.lu.se', Message => "$meddelande",
> Subject => "$amne"
> );
> sendmail(%mail) or die $Mail::Sendmail::error;
> &do_reply;
> exit;
>
>
> sub do_bcc
> {
> open(INFO, $datafil);
^^^^^^^^^^^^^^^^^^^^^
See below.
> @lines = <INFO>;
> close(INFO);
> $bcc = @lines;
^ ^
Here you are assigning an array to a scalar, which is not what you want.
You probably want something like $bcc = join(',',@lines);
But it may not matter, as you've performed an open without checking for
success,e.g.
open(INFO, $datafil) || die "Failed to open $datafil...$!";
so we don't know whether *anything* has actually been read into @lines.
> }
>
> ###############The datafile contents##########
> webmaster@ostas.lu.se,
> webmaster@ostas.lu.se,
> webmaster@ostas.lu.se,
> webmaster@ostas.lu.se,
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Tue, 16 May 2000 15:27:52 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Getting words between two strings
Message-Id: <3920DC58.4A60@modulus.com.au>
Matt Collins wrote:
>
> Hi people! I'm afraid i've gotten myself into a little problem here. I
> need to get all the words between two other words non inclusive.
>
> for example:
>
> "hello my name is joe"
>
> or
>
> "blah blah blah ni hello my name is joe blah blah blah blah blah blah
> blah"
>
> i need to get "my name is" out of that sentence with the sentence being
> held in a variable.
>
> Any help i could get would be awesome!
And you'll help yourself awesomely by reading:
perldoc perlop
and
perldoc perlre
my $string = 'blah ni hello my name is joe blah blah ';
if ($string =~ /.*?hello\s+(.*?)\s+joe.*/){
print $1;
}
else{
print 'no match';
}
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Mon, 15 May 2000 23:47:13 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Getting words between two strings
Message-Id: <3920EEF1.42CD3B4B@stomp.stomp.tokyo>
Matt Collins wrote:
> Hi people! I'm afraid i've gotten myself into a little problem here. I
> need to get all the words between two other words non inclusive.
> for example:
> "hello my name is joe"
> or
> "blah blah blah ni hello my name is joe blah blah blah blah blah blah
> blah"
> i need to get "my name is" out of that sentence with the sentence being
> held in a variable.
> Any help i could get would be awesome!
Hello Matt,
Rather than answer your question directly, I will
afford you help by presenting a challenge and by
presenting some tools to use to meet this challenge.
Extracting "my name is" from a string is
simply too easy. This only requires a decent
matching operator which I am sure will be posted
for you in many different forms. Why not take this
well beyond a simple matching operator and into
a tool of great versatility?
I have written a script for you which exemplifies
very basic and I mean extremely basic concepts in
extracting words based on predicting human nature.
This is actually the very foundation of Natural
Language Emulation via Perl, otherwords, the
concept behind artificial intelligence, which
is my true specialty in using Perl as some have
noted in visiting one of my sites.
This script is ready to go. You may load it to
your server, then plug and play.
Should you or others elect to play with this
script, there are many hidden learning lessons
within my verbose yet easy to understand code.
These lines:
$in{Input} =~ s/\.//g;
$in{Input} = " $in{Input} ";
Those are quite intentional. Comment out ( # )
one or both, then test. You will learn and
understand why extracting a word or words,
is very complex yet simple if you wish to
take matching operators beyond their intended
use. This is, if you wish to bend or break a
few rules and, get away with this.
My array normally would be a multi-line data
base, a very complex one at that. This array
in this example script is very simple yet you
will discover why rules are being bent or even
broken. Try adding some meta-characters normally
used in matching operators, and discover what
happens. Use of boundry ( \b ) and others, such
as a question mark ( ? ) will yield interesting
results for you. Break my code, then fix it. You
will certainly learn everything you need to know
to extract words, any words, from a string with
great precision, if you use imagination and don't
mind a lot of work in getting this down pat.
You asked how to extract "my name is" from
a string. With this simple code, you have
more than enough tools to extract anything you
want, besides just a name as I exemplify. Teach
yourself how to do this by testing this code,
learning how it succeeds and how it fails. Then
learn by modifying to ensure greater success.
I believe you might actually enjoy doing this.
This methodology is truly quite simple.
In closing, I use an oddball format for my
print statements. I drop down one line after
the first quote mark. Look at your document
source via your browser and see why; it is
neat, crisp and well organized.
Unfortunately I have to include my usual
disclaimer to prevent problems. This script
affords no security, is not intended for
everyday use. It is a test script to provide
examples of a methodology and to hopefully
provide you with help beyond your asking.
Godzilla!
Tech notes: change your Perl locale. This
is setup for POST action only. You may need
to provide a full URL path to 'test.cgi' or
whatever you decide to name this script.
Some of my longer lines may word wrap in
your newsreader. Use caution. This script
will run under Perl 4 - 5.
#!/usr/local/bin/perl
print "Content-Type: text/html\n\n";
print "
<HTML><HEAD><TITLE>Find Name</TITLE><BODY>
<BR><BR><CENTER>
<FORM ACTION=\"test.cgi\" METHOD=\"POST\">
<INPUT TYPE=\"TEXT\" SIZE=\"50\" NAME=\"Input\"><P>
<INPUT TYPE=\"SUBMIT\" NAME=\"Button\" VALUE=\"FIND NAME\">
</FORM><P><P>
Type in a common sentence giving your first name and click.
</CENTER><P><P>";
&Parse;
sub Parse
{
local (*in) = @_ if @_;
local ($i, $key, $value);
read (STDIN,$in,$ENV{'CONTENT_LENGTH'});
@in = split (/&/,$in);
foreach $i (0 .. $#in)
{
$in[$i] =~ s/\+/ /g;
($key, $value) = split (/=/,$in[$i],2);
($value eq "") && next;
$key =~ s/%(..)/pack ("c",hex($1))/ge;
$value =~ s/%(..)/pack ("c",hex($1))/ge;
$in{$key} .= $value;
}
return 1;
}
@Find_Name = ("name is (.*) ",
"call me (.*) ",
"called (.*) ",
"name me (.*) ",
"named (.*) ",
"named me (.*) ",
" (.*) is my name",
" (.*) is my Christian name",
" (.*) is my first name",
" (.*) is my real name",
" (.*) is what I am called",
" (.*) is what I am named",
" (.*) is what my friends call me",
" (.*) is what my parents named me");
$in{Input} =~ s/\.//g;
$in{Input} = " $in{Input} ";
if ($in{Input})
{
foreach $element (@Find_Name)
{
if ($in{Input} =~ /$element/i)
{
$name = $1;
}
}
print "
Your Name Is: $name <P>
You Said: $in{Input}";
}
print "
</BODY></HTML>";
exit;
------------------------------
Date: Tue, 16 May 2000 06:58:53 GMT
From: jake_spoon54@my-deja.com
Subject: Re: Help with Perl/CGI scripts
Message-Id: <8fqrj8$9gs$1@nnrp1.deja.com>
I am new to PERL/CGI, wondering where I can find a good resource for
guestbook and registration form. I have created the page
(http://www.mhz.net/gmac/conferences/register/cyber-business.shtml) However,
this page uses a form processor not real CGI. Any advice?
Thanks.
Jake
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 16 May 2000 04:54:06 GMT
From: Scott Houck <shouck@bellatlantic.net>
Subject: Re: How do I get a user's home directory with NIS+?
Message-Id: <q6l1issmfimgcmcc89goht4smkka64ns8o@4ax.com>
Not with NIS+. But $ENV{HOME} is just fine! Problem solved.
gerg@ncal.verio.com (Andrews) wrote:
>Scott Houck <shouck@bellatlantic.net> writes:
>>I have a Perl program where I'd like to store options the user wants
>>to save in a .dot file in their home directory. This is on Solaris
>>2.6 with NIS+, so I can't use getpwent.
>>
>
>Of course you can use getpwent().
>
> -Greg
------------------------------
Date: 16 May 2000 08:46:22 GMT
From: csaba_r@my-deja.com (Csaba Raduly)
Subject: Re: How to COPY a website
Message-Id: <8F36699A1quuxi@193.82.145.131>
15 May 2000: A formal bug report was sent to Seti@Home, because the
following message originated from detop@fly.srk.fer.hr (Dejan
Topalovic) was reported as containing signs of intelligence:
> Keith Smith <ksmith@firesnacks.com> je napisao:
>
>|Are there any good scripts out there for retrieving all the files
>|found at a website? Essentially, I would like to point this tool
>|at a URL and have it decend all the local links and retrieve all
>|the content associated with static html links.
>
>Try 'wget' on Unix or Linux OS if you have.
>Syntax is:
>wget -b -np -nc -r -l0 -L -o status.log http://domain.name/ &
>
>Type 'man wget' in your shell.
>
there's also pavuk (slovak for spider),
http://www.idata.sk/~ondrej/pavuk/
It has enough command-line options to give any un*x program a run for
their money :-) and an X interface too.
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/IT/MU d- s:- a31 C++$ UL+ P+>+++ L++ E- W+ N++ w++>$ O++$
M-(+) V- PGP- t+ X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK-----
------------------------------
Date: Tue, 16 May 2000 15:19:22 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: How to lock a tie()d file?
Message-Id: <3920DA5A.1066@modulus.com.au>
Leslie Neilan wrote:
>
> Thanks to everyone who helped with this question. Ya know, this might
> be the nicest group on the net.
Only when it's not grumpy.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Tue, 16 May 2000 09:34:06 GMT
From: stbruno@my-deja.com
Subject: Java/Perl lingo
Message-Id: <8fr4me$jm9$1@nnrp1.deja.com>
Does anyone know if this is still available as part of Perl5.6 and if there's
any documentation?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 15 May 2000 20:01:19 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Job
Message-Id: <8fphhv$kl4$1@orpheus.gellyfish.com>
In comp.lang.perl.misc Steve <sjlen@ndirect.co.uk> wrote:
> On Fri, 12 May 2000 20:34:21 GMT, patric-REMOVE-@kajen.com wrote:
>>Hi!
>>
>>I wonder if there is anyone who knows any good sites where you can find
>>temporary Perl jobs or knows anyone who is looking for a temporary
>>programmer? Or any companys that hire overseas Perl programmers?
>
> try http://www.jobserve.co.uk if you d/l their database (over 5000 jobs),
> I've written a script that butchers it into a human readable format and
> allows you to weed out the ones you're not interested in based on key
> words that you supply in a text file.
But dont give them your telephone number or you'll be hassled by recruiters
for the rest of your born days ....
/J\
--
Well, I'm tired of being a wannabe league bowler. I wanna be a league
bowler!
--
fortune oscar homer
------------------------------
Date: Tue, 16 May 2000 04:16:22 GMT
From: afay3483@my-deja.com
Subject: Re: make error: missing file separator
Message-Id: <8fqi2a$von$1@nnrp1.deja.com>
I feel kind of stupid now. I was looking at the wrong makefile (ie
Makefile instead makefile). Anyway, on line 570 or whatever it was there
was a stray 0 on a line by itself. Anyone have any idea where this came
from?
Thanks,
Avery Fay
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 15 May 2000 21:05:26 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: MS Word to Text help
Message-Id: <3920C906.D43B9D32@vpservices.com>
JB Goss wrote:
>
> I was wondering if anyone had any ideas on a Perl filter. I was looking for
> something simple to strip out the nasty stuff in a Word document and just
> leave the text, nothing fancy.
The OLE::Storage module does that, I believe. Or if you're on windoze,
use win32::OLE to fire up word, open the document and save it as text.
--
Jeff
------------------------------
Date: Tue, 16 May 2000 09:35:35 +0200
From: Sigvald Refsum <sigvald.refsum@siemens.no>
To: JB Goss <jgoss@goss-com.com>
Subject: Re: MS Word to Text help
Message-Id: <3920FA47.9E53F6DF@siemens.no>
JB Goss wrote:
> I was wondering if anyone had any ideas on a Perl filter. I was looking for
> something simple to strip out the nasty stuff in a Word document and just
> leave the text, nothing fancy.
>
> Thanks,
> JB
his is an example I use to start from when I need to access the
text of Word documents.
The script is far from perfect and is only ment to demonstrate
functionallity, any syntaxt can be wrong.
Hope this helps
Sigvald Refsum
Scrip for Word follows:
###########################################
use File::Basename;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Word';
use Win32::Clipboard;
use strict;
my ($Arg,$Doc,$CurrentFile);
my $Word = Win32::OLE->new('Word.Application', 'Quit')
or die "Couldn't run Word";
foreach $Arg (@ARGV)
{
$CurrentFile = basename($Arg,"\.doc");
# Watch what happens
# $Word->{Visible} = 1;
# Open file ----
# Beware of escape characters
my $Doc = $Word->Documents->Open('C:\\'."$Arg");
#Turn of revision marks
with ($Doc, ShowRevisions => 0);
#Do your access .....
# Navigate using bookmarks
# $Doc->GoTo({What =>wdGoToBookmark, Name =>
'BookmarkName1'});
# $Doc->Bookmarks('BookmarkName1')->Select();
# my $Range = $Word->Selection();
# with ($Range, ExtendMode => 1);
# $Range->GoTo({What => wdGoToBookmark, Name =>
'BookmarkName2'});
#Just select the complete document
$Doc->Select();
my $Range = $Word->Selection();
with ($Range, ExtendMode => 1);
$Range->SelectAll();
# Copy selection to clipboard
$Range->Copy();
# Close file without saving
$Doc->Close({SaveChanges => wdDoNotSaveChanges});
# Create temp file
open(TextFile,">$CurrentFile.txt");
printf TextFile ("%s\n", Win32::Clipboard::Get());
close TextFile;
# Close file without saving
$Doc->Close({SaveChanges => wdDoNotSaveChanges});
}
# Disconnect OLE
undef $Word;
------------------------------
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 3058
**************************************