[10970] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4570 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 7 09:07:19 1999

Date: Thu, 7 Jan 99 06:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 7 Jan 1999     Volume: 8 Number: 4570

Today's topics:
    Re: automatic ftp <ebohlman@netcom.com>
    Re: Can't find my way with a map <aeb@saltfarm.bt.co.uk>
    Re: CFV: what's with all the job posts? <ebohlman@netcom.com>
    Re: CGI Redirection miko@idocs.com
    Re: comp/comp3 numbers in Perl or maybe C JBHenry@excite.com
        Conditional inclusion of modules <jjn@sanger.ac.uk>
    Re: couldn't spawn process error (robert)
    Re: Decrypting perl programs (Filter module) <steveh_removethis@sinbad.net>
    Re: Delete Directory Paradox?? <newsposter@cthulhu.demon.nl>
    Re: Deleting a line in a HTML File <newsposter@cthulhu.demon.nl>
    Re: Excel to HTML converter? <pvonk@skidmore.edu>
    Re: Help reading/rewriting file <ebohlman@netcom.com>
        How can I send mail with file ? <k25@ms4.hinet.net>
    Re: How can I send mail with file ? dave@mag-sol.com
    Re: how do you pass a query string while debugging in d dave@mag-sol.com
        how to paste text from cpan script <wedeking@msw0.attnet.or.jp>
        HTML:Parser <steveh_removethis@sinbad.net>
    Re: line noise (Bart Lateur)
    Re: line noise <bradw@newbridge.com>
    Re: Lists of Lists in Perl 4 (Clay Irving)
    Re: MacPerl: deleting a file rupert@no.spam.leeds.ac.uk
    Re: Nasty regexp .... help! (Bart Lateur)
    Re: Nasty regexp .... I'm stumped. <ebohlman@netcom.com>
    Re: Need CGI database dave@mag-sol.com
    Re: Not bad page for newbies.... <kistler@gmx.de>
    Re: ORACLE DBD compile error (Stephen Clouse)
    Re: Password Encryption <newsposter@cthulhu.demon.nl>
    Re: Perl & Java ? <martinb@talx.com.no.spam>
        Perl script error problem (John )
    Re: Please Help!! <hawkwynd@adelphia.net>
        Problem with Perl script (John )
        Randal's code [was Re: How do I delete tmp files based  mark_thomas@my-dejanews.com
        Rookie - Troubles with gd <pleyer@kraftwerk.co.at>
    Re: socket programming: picking a port automatically <newsposter@cthulhu.demon.nl>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 7 Jan 1999 08:48:41 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: automatic ftp
Message-Id: <ebohlmanF56Lt5.CvC@netcom.com>

Rob S <rob.slattery@amaonline.com> wrote:
: I need my script to get a simple
: ascii file located on another server.

: How should I go about this?

Depends on what kind of a server it is.  If it's an HTTP server, use the 
LWP module.  If it's an FTP server, use Net::FTP.  If it's an NFS server, 
just use the ordinary file operations.


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

Date: 07 Jan 1999 10:15:30 +0000
From: Tony Bass <aeb@saltfarm.bt.co.uk>
Subject: Re: Can't find my way with a map
Message-Id: <rg7luzie2l.fsf@calf.saltfarm.bt.co.uk>

"Michael Mongeau" <michael_mongeau@stratus.com> writes:

> Jerry Pank <jerryp.usenet@connected.demon.co.uk> wrote in message
> news:DR2nTBAvx4k2EwgS@connected.demon.co.uk...
> >I want to use map to remove leading/trailing quotes that may exist in a
> >tab delimited file:

[...]
>     @data = map { s/^"|"$//g; $_ } split /\t/, $line;

> The problem with this is that the s/// modifies the original list being
> mapped.  If that's a problem you can create a local variable and perform the
> substitution on that:
[...]


Or alternatively there is a non-destructive technique with matching,

   @data = map m/^"?(.*?)"?$/, split /\t/, $line;

though this particular regex may be doubtful if performance is an issue.


-- 
# A E Bass                                      Tel: (01473) 645305
# MLB 3/19, BT Laboratories                     e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 3RE   Do not rely on From: line
#                                               Opinions are my own


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

Date: Thu, 7 Jan 1999 08:45:16 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: CFV: what's with all the job posts?
Message-Id: <ebohlmanF56LnG.CtG@netcom.com>

Uri Guttman <uri@home.sysarch.com> wrote:

: c.l.p.misc seems to have had a recent bombardment of perl job
: postings. they are generally considered OT and semi-spam. what are your
: thoughts on c.l.p.jobs?

: that group would be about jobs offered and wanted, discussions about
: perl at work (not technical, but finding jobs or promoting perl at
: work), and other related issues. i don't know if the volume is there for
: a split but we seem to be getting a few a day now which matches the
: moderated group volume. it also might encourage more job related posts
: and would make for a better place to do that. the only perl jobs/resume
: registry i know is at the perl journal (www.tpj.com) and it is weak
: (sorry jon).

Unless the group is moderated, it will simply become yet another 
repository for recruiter database dumps, just like all the other *.jobs 
groups.  Certainly anything remotely related to WWW development will wind 
up in there, whether involving Perl or not.



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

Date: Thu, 07 Jan 1999 09:54:29 GMT
From: miko@idocs.com
Subject: Re: CGI Redirection
Message-Id: <77208m$di3$1@nnrp1.dejanews.com>

(I know I'm responding to a really old posting, but I was so exasperated...)


In article <8cyaok5aa0.fsf@gadget.cscaper.com>,
  Randal Schwartz <merlyn@stonehenge.com> wrote:

> [snip]
>   Or return a page for a
> bad URL that says "that's not found" in some randomly changing text
> and then still return status 200 because it's an "expected error"
> instead of a proper 404 so I can detect it as a dead link.

I know I'll sound naive here, but are you saying that people do that
INTENTIONALLY? Sheesh, I was wondering why so many servers didn't return a
proper 404.

These incorrect 200's really wreak havoc with WWW::RobotRules.	It doesn't
understand that it's not reading a real robots.txt.  My idea on dealing with
this problem is that WWW::RobotRules (or perhaps it should be RobotUA or
whatever the user agent) should make sure that Content-Type is text/plain
before trusting a status of 200.  I don't know (and couldn't find) any
standards on what the robot should do if robots.txt is incorrectly formatted,
but perhaps it should be standard that the robot assumes it is not welcome. 
*That* would get a lot of sites into conformance when they find out that the
search engines won't index them.

-miko

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 07 Jan 1999 12:35:11 GMT
From: JBHenry@excite.com
Subject: Re: comp/comp3 numbers in Perl or maybe C
Message-Id: <7729lv$kqp$1@nnrp1.dejanews.com>

In article <770851$ct6@dfw-ixnews4.ix.netcom.com>,
  "William M. Klein" <wmklein at ix dot netcom dot com> wrote:
> For those who are about to scream about the answer that was given by Jeff
>
>     BUT ALL THE COMP values are HARDWARE/SOFTWARE/COMPILER dependent,
>
> Please notice the original reference to "DB2" which makes the assumption
> that the "mainframe" is an "IBM mainframe" fairly safe.

Yes, that is the assumption I was making. I should have stated that in my
post, or at least said "YMMV".

> Note to original requester:  If you are *NOT* talking about an IBM
> mainframe, then the answers given below may (and probably ARE) *wrong*
>
> FYI,
>   The response given for "COMP" (not COMP-3) is a little incomplete.  There
> are methods in IBM mainframe COBOL of specifying COMP fields that create
> half-word, full-word, or double-word binary fields (and with many PC
> products single-byte binary fields - but if you get into PC's, then you need
> to worry about big-endian/little-endian issues as well).

You are correct, sir. I never even considered the endianism problem at all.
You mention it in relation to PC's, but couldn't he have that problem
transfering data from Unix, as well (at least on some hardware)?

Thanks for the clarification.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 07 Jan 1999 12:30:12 +0000
From: Jonathan Nicholson <jjn@sanger.ac.uk>
Subject: Conditional inclusion of modules
Message-Id: <3694A8D4.4299B789@sanger.ac.uk>

Hi,

I want to include different modules depending on which version of the
program is running. This will allow me to maintain one program which can
access a variety of databases.

I've tried the following code:-

my $c = $0;

if($c =~ /.*\/([^\/]+)$/) {
	$c = $1;
}

if($c eq 'aprogram') {
	use amodule;
elsif($c eq 'othercode') {
	use another;
}
else {
	die "Dunno which module to use\n";
}


This doesn't work because it sees redefinitions of subroutines at
compile time.

The 2 modules provide the same interface subroutines but access
different databases (in different ways).

Any ideas?

Regards,

Jonathan


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

Date: 7 Jan 1999 11:41:29 +0100
From: robert@il.fontys.nl (robert)
Subject: Re: couldn't spawn process error
Message-Id: <77230p$3rj@charm.il.fontys.nl>

"Simmo" <simsi@hotmail.com.nospam>:
 >Has anyone seen this error running Perl 5 on FreeBSD latest version:
 >   couldn't spawn child process: /home/xxx/www/cgi-bin/client/logon.pl
 >The error crops up occassionally but after repeated reloads clears itself.

Check to see if the user running those scripts (I assume it be 'nobody') is
in any way limited with regards to the number of processes it can run. You
can check with 'sysctl kern.maxprocperuid' if the kernel-limit might be too
low, or check if the calling process (your httpd, I presume) isn't being
run in some ulimited environment.

                                                                      robert


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

Date: Thu, 7 Jan 1999 02:04:34 -0900
From: "Steve" <steveh_removethis@sinbad.net>
Subject: Re: Decrypting perl programs (Filter module)
Message-Id: <3694947b.0@pavlof.gci.net>

It is actually really easy to decrypt..
Before installing the filter module insert a print command after the
de-encryption  and dump its contents to a file... You should be able to find
it fairly easy.. After inserting your changes install the module and your
done.. Every program that runs through the FILTER, they all must in order to
run, will dump the contents to your temp file.

Easy.

Steve



tobi@xgm.de wrote in message <76as8c$o0c$1@nnrp1.dejanews.com>...
>Hi,
>
>is there a way to de-crypt perl programs, encrypted with
>the "Source Filter" module (Filter-1.14.tar) by Paul Marquess?
>This library can be obtained through CPAN, the address is
>   http://www.cpan.org/authors/Paul_Marquess/Filter-1.14.tar.gz
>It looks like a real challenge...
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: Thu, 07 Jan 1999 08:36:29 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Delete Directory Paradox??
Message-Id: <3694B85B.210792A6@cthulhu.demon.nl>

"Charles R. Thompson" wrote:
> 
> Perl allows me to create directory on my server, but I cannot delete one
> that Perl creates. That doesn't make sense.
> 
> rmdir($fullpath)  || &CgiDie("Cannot remove directory in delete
> directory subroutine. Reason: $!");
> 
> Gives me the error....
> 
> Cannot remove directory in delete directory subroutine. Reason: Is a
> directory
> 
> umm..duh?

- Check the permissions of the parentdirectory of the directory to be
  removed.
- Check whether the directory is empty
- Check whether the directory is in use by something

I had a simular problem when trying to rm files they were open
by another process. 'Cannot unlink file. File exists' :)

Erik
-- 
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely.  And everyone who owns a car intends that it be used as a
portable dumpster.  Any unwanted garbage in their vehicle they can
simply throw away, after all.


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

Date: Wed, 06 Jan 1999 14:32:00 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Deleting a line in a HTML File
Message-Id: <3693BA2B.77B4280@cthulhu.demon.nl>

Yoann Le Corvic wrote:
> 
> I created a small system that generate an index of file dynamically
> using perl. When a user from the Internet send a request, it's stored,
> and a new line is added in the index. But now, I have another problem. I
> need to remove this line dyna,ically when someone from support reply to
> it.
> 
> I can I remove dynamically a table line from a HTML Document ???

Read the page, remove the line, write new version of the file.
The HTML::Parser module might help you with it.

Erik
-- 
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely.  And everyone who owns a car intends that it be used as a
portable dumpster.  Any unwanted garbage in their vehicle they can
simply throw away, after all.



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

Date: Tue, 05 Jan 1999 16:22:12 -0500
From: "Pierre A. von Kaenel" <pvonk@skidmore.edu>
Subject: Re: Excel to HTML converter?
Message-Id: <36928284.3D9C4F1A@skidmore.edu>

I think I'm missing something - Why not use Excel to convert it?

Damon K. Haley wrote:
> 
> Hello,
> 
> Is there an excel to html converter out there?
> I found MSWordview which does a great jobs
> of converting Word97 to html.
> http://www.gnu.org/~caolan/docs/MSWordView.html
> 
> I also found this page (http://arturo.directmail.org/filters/)
> of MS converters but didn't find an excel2html
> converter that is available yet.
> 
> Does anyone know of one or when one will be released?
> 
> Thanks
> 
> Damon Haley

-- 
Pierre A. von Kaenel
Math & Computer Science Dept.
Skidmore College
Saratoga Springs, NY 12866


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

Date: Thu, 7 Jan 1999 08:15:51 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help reading/rewriting file
Message-Id: <ebohlmanF56KAF.BH0@netcom.com>

jdennis@alldata.net wrote:
: I have a file that consists of multiple line HTML records, for lack of a
: better term.  Each "record" starts with an <H3> tag on the first line.	I
: need to take this file, read it in, remove the html tags, and write it out to
: a flat file, where each field is separated by a pipe sign and each record is
: now on one line.

: I can read the file fine, and rewrite it to another file.  Where I am having
: trouble is the syntax to strip out the html, and then how to write the multi
: line record to a single line record.

Use HTML::Parser or one of its descendants, possibly HTML::Filter.



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

Date: Tue, 05 Jan 1999 01:02:45 +0800
From: Mecer <k25@ms4.hinet.net>
Subject: How can I send mail with file ?
Message-Id: <3690F434.81E15C23@ms4.hinet.net>

I want to send mail with mail...
But I don't know how to use any module or function to
compress files with base64...
Is there any module or function which can do this ?
How to decompress files ?
Please teach me...Thanks...



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

Date: Thu, 07 Jan 1999 12:03:07 GMT
From: dave@mag-sol.com
Subject: Re: How can I send mail with file ?
Message-Id: <7727pr$jds$1@nnrp1.dejanews.com>

In article <3690F434.81E15C23@ms4.hinet.net>,
  Mecer <k25@ms4.hinet.net> wrote:
> I want to send mail with mail...
> But I don't know how to use any module or function to
> compress files with base64...
> Is there any module or function which can do this ?
> How to decompress files ?
> Please teach me...Thanks...

You should look at the Mail::Tools and MIME::Tools packages on CPAN,
<http://www.perl.com/CPAN/>.

hth,

Dave...

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 07 Jan 1999 11:50:25 GMT
From: dave@mag-sol.com
Subject: Re: how do you pass a query string while debugging in dos?
Message-Id: <772721$isl$1@nnrp1.dejanews.com>

In article <3693D069.2BD2716B@lucent.com>,
  rhw@lucent.com wrote:
> I'm having a similar problem in Unix.
> From a browser:
>          http://........../program.cgi?value
> will pass "value" to program.cgi.  Running the program directly from
> UNIX with a space
>         program.cgi value
> will also pass the value but I'm failing to find how to use the "system"
> command to pass the value.
> From within another perl script running:
>        system "program.cgi", "value";
> will execute program.cgi but "value" doesn't get passed to it.
>
> Can anyone help?  I haven't found this in any literature thus far.
> ===================================================================
>
> jm wrote:
>
> > how do you pass a query string while debugging in dos?
> >
> > please email to mailto:jminder@bellsouth.net

If you use CGI.pm to develop your CGI script, it will prompt you for
parameters when you run it from the command line.

Yet another good reason for using CGI.pm.

hth,

Dave...

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 7 Jan 1999 22:17:14 +0900
From: "Dan Wedeking" <wedeking@msw0.attnet.or.jp>
Subject: how to paste text from cpan script
Message-Id: <772c5i$lra$1@news.misawa.attmil.ne.jp>

I found a script at:

ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/scripts/text-processing/tcgrep

But when I highlight it and use control c to copy it than control v to paste
it to notepad,
the carrage returns don't come up in the right place.  Is there any way to
fix this?

Dan




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

Date: Thu, 7 Jan 1999 01:49:52 -0900
From: "Steve" <steveh_removethis@sinbad.net>
Subject: HTML:Parser
Message-Id: <36949101.0@pavlof.gci.net>

I have a file names temp.html.

I would like to run this file through HTML:Parser or HTML::Filter and get
rid of ALL HTML markup.

Can someone please give me the proper code to do this.. For some reason I
just can not seem to get it to work..
And yes I have test perldoc HTML::Parser and Filter and I cant make heads or
tails of it.  Although I claim to be no perl guru.

Regards,

Steve





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

Date: Thu, 07 Jan 1999 11:55:46 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: line noise
Message-Id: <36989eba.15605895@news.skynet.be>

Andrew Mayo wrote:

>May I say, at the risk of adding noise to this group (and for this my
>profound apologies) that compared to comp.lang.basic.visual.misc, the
>quality and timeliness of the replies I have received as a Perl newbie
>posting to this group have been incomparably better than the answers to
>questions placed by other newbies on clbv (where I am in the reverse
>position, as a grizzled VB veteran - and yes, I do try to help, when I have
>time)

Thank you (not), as I'm a regular VB newsgroup poster too.

>Now, given that there are at least as many VB programmers as Perl
>programmers, what does this tell us about Open Source?. To me, the message
>I'm getting is that I am going to get far better support for Open Source
>products than I will for proprietary products.

You're supposed to pay for support for commercial products.<grin>.

	Bart.


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

Date: 07 Jan 1999 08:53:29 -0500
From: bj <bradw@newbridge.com>
Subject: Re: line noise
Message-Id: <op1vhijb352.fsf@kannews.newbridge.com>

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

> Andrew Mayo wrote:

> >Now, given that there are at least as many VB programmers as Perl
> >programmers, what does this tell us about Open Source?. To me, the message
> >I'm getting is that I am going to get far better support for Open Source
> >products than I will for proprietary products.
> 
> You're supposed to pay for support for commercial products.<grin>.

As someone who pays vast tracks of maintenance dollars for support for 
commercial CAD products, I find I have better access to experts and
consistantly better turnaround on the Open Source products that we
use. OTOH, the lack of a formal, legal support requirement makes the
"suits" nervous and upset at times.

bj


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

Date: 7 Jan 1999 08:03:59 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Lists of Lists in Perl 4
Message-Id: <772bbv$9f1@panix.com>

In <76vaqq$21o$1@nnrp1.dejanews.com> dave@mag-sol.com writes:

>Get a new job! Perl 4 is *very* out of date and is known to have security
>holes. Any company that would still make you use it is asking for trouble.

 ...and there are no plans to make it Y2K compliant. :)

-- 
Clay Irving
clay@panix.com


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

Date: Thu, 7 Jan 1999 12:26:37 +0000 (GMT)
From: rupert@no.spam.leeds.ac.uk
Subject: Re: MacPerl: deleting a file
Message-Id: <36951953.2722@no.spam>

> > Hi.  What is the most elegant way of deleting/erasing files under
> > MacPerl?
>
> I guess the same as with other versions of Perl - with 'unlink'.  You
> should  check out the perlfunc manpage (however you might do that on 
> a Mac) for more on that function.
> 

Yes, you use unlink. I imagine that the unix version of unlink
works the same as the MacPerl version.

The perl function page can be viewed from the standard Apple
help menu at the right of the menu bar. It would not surprise
me if people who regularly use Perl in different environments
felt that the Perl documentation system on the Mac was better than
that on any other platform.

On a different tack, it is a fact that the help system for 
MacPerl is better than that for any commercial software
(though clarisworks comes close) and even any other shareware
or freeeware.

Ben.


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

Date: Thu, 07 Jan 1999 11:55:44 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Nasty regexp .... help!
Message-Id: <36979db9.15349010@news.skynet.be>

[posted and mailed]
Zack wrote:

>>ie:  a search on "int??net" should match both internet and intranet
>>     a search on auto* should match "autos, automotive, etc"
> >    a search on *motiv* should match "automotive, motive, motivate"

>I realize the ? problem on the backend, but I can't expect users to know from filling in a form that "." means match the character.  I figure on substituting ? for . in the program before the search takes place.  

>I'm just not sure on the proper syntax for handling all possibilities of user input.

The code that Patrick Timmins posted is already based upon a regexp, so
patching that should be enough.

Also, converting wildcards to regexes is something that has been delt
with too, in the last few weeks. Anyway, I'll recap.

You need to convert every "?" to a ".", and each "*" to ".*", and render
all other characters harmless. But, if you want to match whole words
only, I'd suggest substituting "\w" for ".".

    $_ = "internet and intranet, autos, automotive, motive, motivate";
    print "# Testing '$_'\n";
    foreach $query (qw(int??net auto* *motiv*)) {
        my %wildcard = ( "?" => '\w', "*" => '\w*');
        ($pattern=$query)=~ s/(\W)/$wildcard{$1} || "\\$1"/ge;
        print " $query => $pattern\n";
        while(/\b($pattern)\b/gi) {
            print "Match for $query in $1\n";
        }
    }
__END__
# Testing 'internet and intranet, autos, automotive, motive, motivate'
 int??net => int\w\wnet
Match for int??net in internet
Match for int??net in intranet
 auto* => auto\w*
Match for auto* in autos
Match for auto* in automotive
 *motiv* => \w*motiv\w*
Match for *motiv* in automotive
Match for *motiv* in motive
Match for *motiv* in motivate


   HTH,
   Bart.


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

Date: Thu, 7 Jan 1999 08:00:53 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Nasty regexp .... I'm stumped.
Message-Id: <ebohlmanF56JLI.AuI@netcom.com>

Zack <zack44@altavista.net> wrote:
: I don't know if it's possible to do this in a single expression, but here's what I've been beating my head against the wall trying to do:

: Scan a text string with the following rules:

: 1. Some words are "required"
: 2. Other words are "optional"
: 3. Others are to be "screened"

: 4. Not all 3 of these types of words will be searched for each time, and there may be multiples of each type.

: 5. In other words, a given search may have 1 word 2 screen 1 required word, and 2 optional words.  Another search would have 1 optional word only .... etc.

: 6. For each string searched, I need to report back the number of required matches, the number of optional matches, and the number of screened matches for reporting purposes.

: What I've done so far is build up arrays containing the search terms (@opt, @req, @screen) and then try and go through them, building a big regexp string.  No luck, and quite frankly, my brain is a bit cooked from looking at it so long.

: Any ideas?  Is it possible to do this in a single =~ line?

You probably could, by using the (?{}) zero-width assertion introduced in
5.005; it allows you to evaluate code while matching a regex.  For an
approach to something similar that uses code-evaluation (but doesn't do
the entire thing in one line) take a look at the Text::Query::Simple
module available from CPAN.




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

Date: Thu, 07 Jan 1999 11:39:46 GMT
From: dave@mag-sol.com
Subject: Re: Need CGI database
Message-Id: <7726e2$icq$1@nnrp1.dejanews.com>

In article <770gjb$4ar$1@nnrp1.dejanews.com>,
  philipbrown@my-dejanews.com wrote:
>     Does anyone know where I can download a database which
> will allow people to upload their names, addresses, phone
> numbers, etc to a web site and also allow them to view
> the names, addresses, etc of other people who also uploaded
> this information?  It can use CGI for the server side.

Depends how big this database is going to be. For smaller databases you can
get good results by tieing a hash to a DBM file. For something larger you
could look at something like MySQL.

hth,

Dave...

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 07 Jan 1999 10:24:24 +0100
From: Per Kistler <kistler@gmx.de>
Subject: Re: Not bad page for newbies....
Message-Id: <36947D48.B08C71C5@gmx.de>

Hi Charles

I'm wondering how my page moved to that location. But the
real page with the real email, and which will hopefully
someday be updated, is here, (in Switzerland)
http://eris.discordia.ch/~kistler/perl/intro.html and here:
http://www.vis.inf.ethz.ch/~kistler/perl/intro.html

But the pointer and module stuff is still missing, because I
had no time, since I'm perl hacking all day/night.

Regards, Per.


"Charles R. Thompson" wrote:
> 
> Was just surfing round and found a page that ain't too shabby for
> newbie-newbies.
> 
> All the basics for Perl5 in reference format on one webpage. This guy
> summed up on one page what I spent 50 bucks on a book to learn last
> year. :(
> 
> http://medoc.informatik.tu-muenchen.de/Perl/tut3/index.html
> 
> CT

-- 
Per Kistler kistler@gmx.net
------------------------------------------------------------


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

Date: Thu, 07 Jan 1999 11:54:49 GMT
From: see.sig@for.address (Stephen Clouse)
Subject: Re: ORACLE DBD compile error
Message-Id: <36949fca.1629301@news.kc.net>

On Wed, 6 Jan 1999 17:05:47 -0600  in message
<<F44364C301FCD111906F00805FEAAFAA06F147F8@news.jccc.net> comp.lang.perl.misc>,
Phil Mein <pmein@johnco.cc.ks.us> wrote:

>any ideas on what might be causing this?
>AIX v4.3.1
>Oracle v8.0.4
>Perl v5.x
>DBI v1.03
>DBD v.59
>[snip]

Upgrade to DBI v1.05 and then recompile DBD::Oracle.  This is the same problem I
was having; v1.03 seems to have a slight bug.

-- 
Stephen Clouse -- steve at acme-labs dot com (Anti-Spam enabled)
Acme Labs -- Resident Megalomaniac (http://www.acme-labs.com)


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

Date: Wed, 06 Jan 1999 14:11:23 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Password Encryption
Message-Id: <3693B557.FD97742@cthulhu.demon.nl>

(message reordered to undo the 'reply-before-quote')

Artoo wrote:
> 
> Mike wrote in message <3693686D.24757D41@counter.w-dt.com>...
> >Use perls crypt function. It can't be decrypted, you just crypt both with
> >the same salt and then compare them.

> Is it possible to decrypt anything crypted with the crypt function if you
> have the correct SALT?  We need to be about to de-crypt the encrypted info.
> Otherwise is there anyother good method for crypting?  I've written a simple
> programme to encrypt in my own manor and can de-crypt that but would like
> know about other methods.

The point of the crypt function is that encrypting is fast, and decrypting
takes an awful lot of time. Given enough time (years/centuries/millenia),
anything can be decrypted.

You were talking about the need to decrypt passwords. The entire point
of passwords being encrypted is that you can't (and don't need) to
decrypt them. Assuming you read and understand what Mike wrote, why
do you need to de-crypt the passwords?

Erik
-- 
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely.  And everyone who owns a car intends that it be used as a
portable dumpster.  Any unwanted garbage in their vehicle they can
simply throw away, after all.




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

Date: Wed, 6 Jan 1999 16:17:25 -0600
From: "Martin Bertolino" <martinb@talx.com.no.spam>
Subject: Re: Perl & Java ?
Message-Id: <770nhh$b9l$1@newsin-1.starnet.net>

There is an article on this on the last Dr. Dobbs Journal, February 1998.

Martin

Jason Varsoke wrote in message <36937274.A0F18244@caesun.msd.ray.com>...
>I'm looking for a way to interface a few perl functions with a Java
>GUI that I have.  Does anyone know where I can find any information on
>this topic.  Thanks.
>
>   Please send reply to jjv@caesun.msd.ray.com
>   my news access is limited.
>
>-jason




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

Date: Thu, 07 Jan 1999 10:57:57 GMT
From: John@melon17.freeserve.co.uk (John )
Subject: Perl script error problem
Message-Id: <369492e1.4206862@news.freeserve.net>

As a newbie i wondered if someone
could tell me why i get the following error:

Premature end to script?

John



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

Date: Thu, 7 Jan 1999 07:58:35 -0500
From: "Scott Fleming" <hawkwynd@adelphia.net>
Subject: Re: Please Help!!
Message-Id: <Md2l2.2826$wP4.5657@server1.news.adelphia.net>

>May I suggest a second book?  "Teach Yourself CGI Programming with Perl 5"
by
>Eric Herrmann. When I worked on my Masters Degree, I was required to learn
a
>new language and construct a web application using it and the proper
>techniques.  I bought this book and it was a lifesaver.  It's written for
>novices, but it can be beneficial for the intermediate and advanced
>programmers.

Isn't it "Teach Yourseld CGI Programming with Perl 5 in a week?" by Eric
Hermann? I have the same book, and whole-heartedly agree, this is the one
that hand-fed me through the beginning stages of my script writing.

http://hawkwynd.tzo.com

Hawkwynd





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

Date: Thu, 07 Jan 1999 12:28:18 GMT
From: John@melon17.freeserve.co.uk (John )
Subject: Problem with Perl script
Message-Id: <3694a7e2.1871860@news.freeserve.net>

I am (a newbie) getting an error message
'premature ending of script' for the
following:

#!/usr/bin/perl 
# 
&readparse; 
print "Content-type: text/html\n\n"; 
# 
#*****************BEGIN BODY************* 
print "<h1>Thank you for filling out the form</h1>"; 
$firstname = $value[0]; 
$lastname = $value[1]; 
$email = $value[2]; 
  
print "Your first name is $firstname<BR>"; 
print "Your last name is $lastname<BR>"; 
print "Your e-mail is $email<BR>"; 



Can anyone spot the problem?

john




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

Date: Thu, 07 Jan 1999 12:53:49 GMT
From: mark_thomas@my-dejanews.com
Subject: Randal's code [was Re: How do I delete tmp files based on age?]
Message-Id: <772aot$lmn$1@nnrp1.dejanews.com>

In article <m1zp7x4shv.fsf@halfdome.holdit.com>,
  merlyn@stonehenge.com (Randal L. Schwartz) wrote:

> But I think this would be simpler written as:
>
>     $dirname = 'some_directory';
>     opendir DIR, $dirname or die "...";
>     unlink grep -A > $hold_time, map "some_directory/$_", readdir DIR;
>     closedir DIR;

I always enjoy reading Randal's "simplizations". My usual first reaction is
"Huh?", but then, after analyzing the code, I realize the elegance and almost
always learn something about Perl in the process. In this case I learned a
good use for the map command, which until now hasn't been in my working Perl
vocabulary.

Thanks, Randal, for taking the time to respond to posts with code samples. I'm
sure it improves the coding of countless numbers of casual Perl programmers
like myself.

--
Mark Thomas, who just yesterday entered the third
printf"%x",34*join('',unpack('C*',"*^'"));
of his life!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 07 Jan 1999 14:22:53 +0100
From: Walter Pleyer <pleyer@kraftwerk.co.at>
Subject: Rookie - Troubles with gd
Message-Id: <3694B52D.3B2C07E8@kraftwerk.co.at>

Hi Folks!
 I've got following the problem:
I want to use the gd-lib to generate dynamic images, but can't get the
setup right because
everytime i try to execute my testfile i get  this message:

Can't locate loadable object for module GD in @INC (@INC contains:
C:\PERL\lib C
:\PERL\site\lib .) at test.pl line 2

What's the problem and how can I fix it?

Walter




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

Date: Wed, 06 Jan 1999 13:56:35 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: socket programming: picking a port automatically
Message-Id: <3693B1E0.488479AB@cthulhu.demon.nl>

Daniel Reeves wrote:
> 
> Is there a way for a server program written in perl to automatically pick
> a free port and print it?  (ie, "this server is listening on port x...")

As far as I know there is no 'get_me_a_free_port' function, so you'll
have to write a bit of code to get a port.

Your server should have a call to the 'bind' function somewhere.
Put it in a loop something like this:
    for ($i=2000; $i<3000; $i++) {
        if bind to port $i successful, break out of loop
    }
    if $i == 3000  panic could not get a port

Erik
-- 
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely.  And everyone who owns a car intends that it be used as a
portable dumpster.  Any unwanted garbage in their vehicle they can
simply throw away, after all.




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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4570
**************************************

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