[6351] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 973 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 19 10:17:20 1997

Date: Wed, 19 Feb 97 07:00:24 -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           Wed, 19 Feb 1997     Volume: 7 Number: 973

Today's topics:
     Re: ANNOUNCE: GIFgraph 0.9 <rothd@roth.netX>
     Re: Breaking an @ down to individual fields (Tad McClellan)
     Re: Breaking an @ down to individual fields (Honza Pazdziora)
     Re: Breaking an @ down to individual fields <merlyn@stonehenge.com>
     Re: Bulletin board in CGI/perl <pow@embl-ebi.ac.uk>
     Re: Class library to make C++ more Perlish? <rurban@buehnen-graz.com>
     Re: debugging perl & html <rra@cs.stanford.edu>
     Re: difference btw s/// & tr/// (Tom Grydeland)
     Re: Exemples de petits prog. en perl ? (Nathan V. Patwardhan)
     Gregorian date function <pamram@club-internet.fr>
     Re: html -> rtf perl conversion script (Tad McClellan)
     html -> text <traveler@io.com>
     Job opportunities in Milan <livio@sinapsi.com>
     Length of an assoc. array? (Kovacs Anita)
     Need Perl5 version of AUB script..or fixes <raymond.l.gates@larc.nasa.gov>
     Perl and MsAccess (Chad Adams)
     Perl program in crontab problem (Clay Irving)
     Re: Perl program in crontab problem (Nathan V. Patwardhan)
     Re: Perl Sockets reprise (Tom Grydeland)
     Perl vs C/C++ Benchmarks ? (Jonathan Peterson)
     Re: Rewiite Sort command in NT perl (Dave Thomas)
     Re: Segmentation Fault when using undef (Mike Stok)
     Re: Simple DBM question (Nathan V. Patwardhan)
     Re: Substitute question (Dave Thomas)
     Re: subtle (to me) RE problem (Jeffrey)
     Re: transliteration library <hwhyte@translation-plus.co.uk>
     Win32::EventLog on NT (Louis Lambros)
     Re: Win32::ODBC  $db->close() <rothd@roth.netX>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: 19 Feb 1997 13:53:33 GMT
From: "Roth Consulting" <rothd@roth.netX>
Subject: Re: ANNOUNCE: GIFgraph 0.9
Message-Id: <01bc1e6b$e2e7b060$0100a8c0@www>



Martien Verbruggen <mgjv@comdyn.com.au> wrote in article
<330A5C14.7012@comdyn.com.au>...
> Larry W. Virden wrote:
> 
> > What's the status of the requirement from Unisys to pay licese fees
> > for software which creates GIFs?  There was a lot of hoopla about this
> > on Compuserve a few yrs ago, and since that time I have seen notes from
> > the author of xv, the author of the GD perl package, etc. referring to
> > problems with such software.
> 
> As far as I know, the use of LZW compression stuff is allowed without
> licensing fees for non commercial products. I have requested the up to
> date info from Unisys, and will let you know.

I was under the impression that they would grandfather in products created
during the "flex" period between the patent's inception and the date they
announced the crackdown. If this is true, then since the GD library was
written during this period of time be exempt from any patent infringment?
And since GD is the graphics lib in this case, wouldn't GIFgraph be exempt
also? Or am I dreaming? ;)
Just my $.02,
dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                         the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                 trailing 'X' to send me email.
****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.



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

Date: Wed, 19 Feb 1997 05:40:02 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Breaking an @ down to individual fields
Message-Id: <iqoee5.pk.ln@localhost>

Honza Pazdziora (adelton@fi.muni.cz) wrote:
: "fissio" <fissio@fission.com> writes:

: > I am using Selena's Database Search 2.0 which searches a pipe delimited data
: > file and returns is to the
: > user.  Right now the script spits out the data in a straight line of text
: > which doesn't look good in the browser.

: I am not familiar with Selena's Database Search 2.0, so may be ou t of
: context. If it searches a pipe delimited data, do these data look like

: name   | first name | address      | home directory

: on one line, whatever the fields are?

: > What I would like to do is breakdown the "@row" and print out each field

: If so, doe the engine really returns you @row, an array? You say it is
: a straight line of text, isn't it rather $row, a scalar that holds one
: line? If that was the case, you would write the loop as

: for $field (split /|/, $row)

: which would split the line on delimiters.
        ^^^^^^^^^^^          ^^^^^^^^^^^^^

It would if you escape the vertical bar ;-)

for $field (split /\|/, $row)
#                  ^


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Wed, 19 Feb 1997 13:56:57 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Breaking an @ down to individual fields
Message-Id: <adelton.856360617@aisa.fi.muni.cz>

tadmc@flash.net (Tad McClellan) writes:

> Honza Pazdziora (adelton@fi.muni.cz) wrote:
> 
> : for $field (split /|/, $row)
> 
> : which would split the line on delimiters.
>         ^^^^^^^^^^^          ^^^^^^^^^^^^^
> 
> It would if you escape the vertical bar ;-)
> 
> for $field (split /\|/, $row)
> #                  ^

Sorry ;-) feeling really bad now.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 19 Feb 1997 07:12:49 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Breaking an @ down to individual fields
Message-Id: <8c914kevfi.fsf@gadget.cscaper.com>

>>>>> "Honza" == Honza Pazdziora <adelton@fi.muni.cz> writes:

Honza> for $field (split /|/, $row)

Nope.  Deceptively wrong.  You want /\|/.  Remember that | is a special
character in a regex.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 559 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 19 Feb 1997 11:18:28 GMT
From: Jean-Jack Riethoven <pow@embl-ebi.ac.uk>
To: Hongyu Zhang <hyzhang@scripps.edu>
Subject: Re: Bulletin board in CGI/perl
Message-Id: <Pine.OSF.3.95.970219111707.22829B-100000@uranus.ebi.ac.uk>

On Tue, 18 Feb 1997, Hongyu Zhang wrote:

> I am going to creat a WWW bulletin board for our group, which, as I
> know, in most cases is implemented in CGI/perl. Not to reinvent the
> wheel, I'll be grateful to get your guys' help on the relevant
> text/code.

Check out the WWWBoard scripts from Matt Wright. You can find them at
http://worldwidemart.com/scripts/

Cheers,

---
Jean-Jack Riethoven

EMBL Outstation - Hinxton                 pow@embl-ebi.ac.uk     
European Bioinformatics Institute         Phone: (+44) 1223 494635      
Wellcome Trust Genome Campus              Fax  : (+44) 1223 494468
Hinxton, Cambridge CB10 1SD               URL  : http://industry.ebi.ac.uk/
UNITED KINGDOM



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

Date: Wed, 19 Feb 1997 14:46:59 GMT
From: Reini Urban <rurban@buehnen-graz.com>
Subject: Re: Class library to make C++ more Perlish?
Message-Id: <330b10a4.27613526@news.sime.com>

On Tue, 18 Feb 1997 13:44:59 +0000, Ben Jefferys wrote:
>Hi I'm looking for a class library to give C++ some of the cool
>functionality in Perl. Ideally it'd have scalar, array,
>associative array classes and overload standard operators
>as per C++. It should also have search, pattern matching
>and so on as functions in the scalar class.

splash is the best!

look for the c++ library faq.

"The SPLASH c++ class library

(Small Perl-like List And String Handling class library)

SPLASH is a c++ class library that implements many of the Perl
constructs and data types, including extensive regex regular expression 
pattern matching.

For those not familiar with Perl, it is an excellent scripting language
by Larry Wall and is available for most platforms.

This Class library provides List, String, Regular Expression, and text
manipulation handling capabilities based on those provided in Perl.

This is available as a compressed tar file, shar file, .zoo or .zip format
with MSDOS compatible names.

contact: morris@netcom.com

        ftp from netcom.com
        in pub/morris/splash.tar.Z
        and pub/morris/splash.shar.Z
        and pub/morris/splash.zip (DOS)
        and pub/morris/splash.zoo (DOS)
"
                                             - Reini
AutoCAD stuff:   http://xarch.tu-graz.ac.at/autocad/


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

Date: 19 Feb 1997 06:45:38 -0800
From: Russ Allbery <rra@cs.stanford.edu>
To: cutt@netcom.com (Paul S. Cutt)
Subject: Re: debugging perl & html
Message-Id: <qumiv3o97n1.fsf@cyclone.stanford.edu>

[ Posted and mailed. ]

Paul S Cutt <cutt@netcom.com> writes:

> I wonder what people are using to debug perl scripts when called from an
> html page ? I know about perl debugger but this is run from the command
> line. If my html page calls my perl script how can I get the debugger at
> that point to execute so I can continue debugging ?

If the Perl script doesn't rely on submitted data from forms or output
HTML, you should be able to test it by just running it from the command
line as normal and making sure it does what it should.

If your Perl script is processing forms, use the CGI.pm module, and then
you can run the script from the command line and give it key/value pairs
on stdin for testing purposes.

There's also the tried and true debugging method, which I still think
works better than debuggers in many, many circumstances.  Namely, print
statements.

(I've yet to really use the Perl debugger, despite the fact that I've
written some fairly large applications in Perl.)

-- 
Russ Allbery (rra@cs.stanford.edu)      <URL:http://www.eyrie.org/~eagle/>


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

Date: 19 Feb 1997 10:39:51 GMT
From: tom@palver.nospam.eiscat.no (Tom Grydeland)
Subject: Re: difference btw s/// & tr///
Message-Id: <TOM.97Feb19113951@palver.nospam.eiscat.no>

In article <5ecq3q$j37@minox.tripnet.se> bw@mail2.tripnet.se (Bertil Wennergren) writes:

> Honza Pazdziora skribis:
> : bw@mail2.tripnet.se (Bertil Wennergren) writes:

> : I hope you can still do
> : tr/abcdefgh/iijjkkll/;

> What I wanted was this:
> 
> s/ab/i/g;
> s/cd/j/g;
> s/ef/k/g;
> s/gh/l/g;

% perl -de 0

main::(-e:1):   0
  DB<1> %trans = (ab => i, cd => j, ef => k, gh => l)
 
  DB<2> $pat = join '|', keys %trans
 
  DB<3> p $pat
ef|ab|gh|cd
  DB<4> $_ = krabbefisk
 
  DB<5> s/($pat)/$trans{$1}/eg
 
  DB<6> p
kribkisk
  DB<6> n
%

As long as your patterns are not more complicated than that, that
trick should work.  Under -w or use strict, you'll need quotes on your
strings and replacements.

I think this trick is due to Gisle Aas, but I'm not sure.

> Bertilo Wennergren

//tom


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

Date: 19 Feb 1997 13:45:30 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Exemples de petits prog. en perl ?
Message-Id: <5ef05q$h9u@fridge-nf0.shore.net>

Dominique BAGOT (Dominique.BAGOT@cetp.ipsl.fr) wrote:

: 	connaissez-vous un (des) sites ayant des programmes
: ecrits en perls a des fins pedagogiques. J'ai fait du perl il y a
: assez longtemps et j'aimerais m'y remettre rapidos a l'aide
: de petits exemples.

Do I know a place where beginners can learn about Perl?  A place where
there are complete programs?  Are you looking to learn quickly by example?
(High school french, pardon me - it's been since 1989, so I'm way rusty!).

If this is the case:
http://www.perl.com/perl -> follow links to documentation
http://www.yahoo.com -> search for Perl documentation.
http://www.dejanews.com -> search for the archives of this newsgroup

--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"


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

Date: Wed, 19 Feb 1997 13:18:41 +0100
From: pascal amram <pamram@club-internet.fr>
Subject: Gregorian date function
Message-Id: <330AEFA1.913@club-internet.fr>


------------56EF5CC0620F0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii

I would like to know a script or algorythm to create a function that
return me the name of the day from a date format. For example
&which_day("19/02/97") return "Wednesday".
The problem is to get this function with a SIMPLE perl script (no .PM no
more external addins etc) just a good and old perl script..

Many thanks from a newbie

------------56EF5CC0620F0
Content-Transfer-Encoding: 7bit
Content-Type: text/html; charset=us-ascii

<HTML><BODY>

<DT>I would like to know a script or algorythm to create a function that
return me the name of the day from a date format. For example &amp;which_day(&quot;19/02/97&quot;)
return &quot;Wednesday&quot;.</DT>

<DT>The problem is to get this function with a SIMPLE perl script (no .PM
no more external addins etc) just a good and old perl script..</DT>

<DT>&nbsp;</DT>

<DT>Many thanks from a newbie</DT>

</BODY>
</HTML>
------------56EF5CC0620F0--



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

Date: Wed, 19 Feb 1997 06:07:27 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: html -> rtf perl conversion script
Message-Id: <vdqee5.mn.ln@localhost>

Roger Hart (rhart@fas.harvard.edu) wrote:


: I am looking for a perl script to convert a html document into an rtf
: document, preferably source code so that I could modify it and run it on
: my Macintosh.  (I started writing such a script, but it ended up that
: there were too many html codes to complete the project in a reasonable
: time ...)


When I search for 'html2rtf' on AltaVista, I get 22 hits.

None of those work for you?


: Thanks so much,

Uh huh.


: Please send replies to rhart@fas.harvard.edu

Uh uh.

--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 19 Feb 1997 11:23:24 GMT
From: "Dataweaver" <traveler@io.com>
Subject: html -> text
Message-Id: <01bc1e57$f9eedc20$2ddcdbcd@maxkilms.nidlink.com>

Please email a copy of any responses to me.  

I am attempting to write a perl script that converts an html document into
a plain-text document; I intend to do more than just strip out the tags;
for example, i am using s/<hr\s*>/-----/i in the script.  

My two biggest problems right now have to do with the text layout; how
would I tell the script to insert \n's after every seventy-ninth character
in a line, and how would I go about formatting tables so that they're
readable?

------------  Jonathan Lang 
--------------+-----------------------------------
   "Dataweaver", mailto:traveler@io.com    | The Dogma of Otherness insists
  "BTfL", mailto:owner-gurpsnet-l@io.com   | that all voices deserve a
hearing,
  mailto:owner-gurpsworld-l@lists.io.com   | that all points of view have
Web: http://www.io.com/~traveler/site.html | something of value to offer.
Archive: ftp://ftp.io.com/pub/usr/traveler | --David Brin, "Otherness"



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

Date: Wed, 19 Feb 1997 13:51:28 +0100
From: Livio Scandella <livio@sinapsi.com>
Subject: Job opportunities in Milan
Message-Id: <330AF750.10A6@sinapsi.com>

Sinapsi is looking for PERL programmers. Please contact me via e-mail.
-- 
==============================================
Livio Scandella
SINAPSI S.r.l., via Vigevano 15, 20144 Milano
Tel. 02 8392554 - portatile: 0335 6357222
Fax: 02 58105293 - web: http://www.sinapsi.com
==============================================



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

Date: 19 Feb 1997 14:19:15 GMT
From: anita@unicorn.sch.bme.hu (Kovacs Anita)
Subject: Length of an assoc. array?
Message-Id: <5ef253$bjd$1@goliat.eik.bme.hu>

Can I get it somehow?

Thankx

Csaba Tanczos


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

Date: Wed, 19 Feb 1997 08:26:16 -0500
From: Ray Gates <raymond.l.gates@larc.nasa.gov>
Subject: Need Perl5 version of AUB script..or fixes
Message-Id: <330AFF78.41C67EA6@larc.nasa.gov>

Having problems w/ Perl 5 and AUB (assemble Usenet binaries) script.....
anyone out there already fixed this? LMK./....THANKS


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

Date: 19 Feb 1997 14:26:02 GMT
From: cadams@crrel.usace.army.mil (Chad Adams)
Subject: Perl and MsAccess
Message-Id: <5ef2hq$118@goo.npd.usace.army.mil>

Are there any modules for Win 95/NT that will allow CGI access to an MS Access 
database running on the same machine??  I have found references to Oracle. 
informix and others, but none for Access.

Any help would be greatly appreciated, and I will summarize responses if 
necessary.

:)

Cheers!
        Chad Adams
        System Administrator
        USACRREL




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

Date: 19 Feb 1997 08:21:30 -0500
From: clay@panix.com (Clay Irving)
Subject: Perl program in crontab problem
Message-Id: <5eeuoq$8ec@panix.com>

I have a Perl program in the root crontab. When it runs, it doesn't seem to
be interpretted as a Perl program. For example, this code snippet:

  #!/usr/local/bin/perl
  
  use lib "/usr/local/lib/perl5";
  
  $date=`date`;
  ($day,$mm,$dd,$time,$tz,$yy) = split(/\s+/,$date);
   .
   .
  
runs fine from the command line, but barfs when cron runs it:

  /usr/local/bin/web-stats.pl: use: not found
  /usr/local/bin/web-stats.pl: =Wed: not found
  /usr/local/bin/web-stats.pl: syntax error at line 6: `=' unexpected

I've modified /etc/default/cron to include SUPATH and PATH corresponding
to the location of the Perl executable (/usr/local/bin) and the library
(/usr/local/lib/perl5) and I added the "use" pragma, but I'm afraid I'm
missing something very simple and silly.

Can someone walk me through my confusion and point me in the right 
direction?
 
TIA,

-- 
See the happy moron,                             
He doesn't give a damn,                                    Clay Irving N2VKG  
I wish I were a moron,                                        clay@panix.com
My God! Perhaps I am!                             http://www.panix.com/~clay


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

Date: 19 Feb 1997 13:50:36 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl program in crontab problem
Message-Id: <5ef0fc$h9u@fridge-nf0.shore.net>

Clay Irving (clay@panix.com) wrote:
:   #!/usr/local/bin/perl
:   
:   use lib "/usr/local/lib/perl5";
:   
:   $date=`date`;
:   ($day,$mm,$dd,$time,$tz,$yy) = split(/\s+/,$date);

Why bother with the backticks if you don't have to use them?
I'd suggest using localtime().

Since you're not using any Perl 5 modules, why are you using "use"?
(Just wondering).  Is Perl 5 definitely in /usr/local/bin/perl, or
is it in /usr/local/bin/perl5?

If you could show us what your cron entry looks like, it might be
helpful.  I currently run a couple of Perl scripts via cron, and
I've always made sure to use the absolute path to the Perl script
(in the crontab file).  Several of these scripts use "use" - like
my NNTPClient script.


--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"


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

Date: 19 Feb 1997 14:01:08 GMT
From: tom@palver.nospam.eiscat.no (Tom Grydeland)
Subject: Re: Perl Sockets reprise
Message-Id: <TOM.97Feb19150108@palver.nospam.eiscat.no>

In article <856034733.19165@dejanews.com> msosteri@yesic.com writes:

> Oops, I forgot in my last post for information. After binding and
> listening on the data socket, there is this use of select
> 
> select(     (    select(SOCKET), $| = 1        )[0]       );

>From the pink camel, p.174 or the blue camel, p.211:

or (being bizarre and obscure):

  select((select(STDERR), $|=1)[0])

This example works by building a list consisting of the returned value
from select(STDERR) (which selects STDERR as a side effect) and $|=1
(which is always 1, but sets autoflushing on the now-selected STDERR
as a side effect.  The first element of that list (the previously
selected filehandle) is now used as an argument to the outer select.
Bizarre, right?  That's what you get for knowing just enough Lisp to
be dangerous.

End of Quote.

By the way:  (Erratum for the book? Tom Christiansen?)
should this be a statement (ended with ';') like the others?  As it
stands, it is an EXPR (which, if I'm not mistaken, equals the return
value of the outer select, that is, main::STDERR)

This example has been taken out of the perlfunc man page.

> simple select in this situation won't work so there must be something
> special about this cryptic use of select.

Don't know if I can help you there, though.

> mike

//tom


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

Date: 19 Feb 1997 12:22:31 GMT
From: jon@amxdigital.com (Jonathan Peterson)
Subject: Perl vs C/C++ Benchmarks ?
Message-Id: <jon-1902971219190001@amx11.amxdigital.com>

In the last few months I seem to have found myself fighting a battle.
There's new people at work who seem to think that Perl is a 'toy' language
strictly for amateur web page writers circa 1994.

They insist that it is too slow, and we should do all our CGI work in C.
Since I can't write a word of C this is not good.

So, does anyone have any comparisons of Perl/C programs? I don't doubt
that C is going to be faster, but I'd like to know how much by. I've never
written a Perl program that took more than about 3 seconds to run
(excluding ones that made system calls etc.) Times for file operations,
database operations, etc would be ideal, but any comparitive times would
be good.

Since comparative times are (to me, for this context) meaningless for
operations taking under 1.5 seconds (I don't care if C takes only .5
seconds, it's quick enough), if anyone has any fairly heavy duty
Perl/database experience, that would be good too.

P.S. I would be grateful if you could post your replies to this group, as
I can not read my email very frequently :-)
------------------
Opinions expressed above are not necessarily those of AMXdigital ltd.
Jonathan Peterson || jon@amxdigital.com || (+44) 0171 613 5300

"You wouldn't believe the things I've seen with your eyes."


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

Date: 19 Feb 1997 14:03:20 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Rewiite Sort command in NT perl
Message-Id: <slrn5gm1s7.hk3.dave@fast.thomases.com>

On Wed, 19 Feb 1997 14:02:47 +0800, edmond <edmond@email.tech-trans.com> wrote:
> I want to know how to rewrite the following unix commannd in NT perl 5:
>   "sort -u -k .2,12 -k .17,.22 filename"

You have a couple of options:

1. You could use Perl's build-in sort, and do the field extraction in the
   comparison procedure. You'd then do a simple grep to remove non-unique
   values.
   
2. You could pull the sort program off cygnus.com, which is a full gnu sort
   for W95/NT. It has all the options you need.
   
Dave


-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 19 Feb 1997 10:43:57 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Segmentation Fault when using undef
Message-Id: <5eelhd$iph@news-central.tiac.net>

In article <330A7275.5503E077@mail.idt.net>,
Chris Plachta  <stats9@mail.idt.net> wrote:
>Has anyone out there ever had a seqmentation fault when using
>undef?  I am using the undef command to undefine some large hashes
>that I reuse in a subroutine.  After the second time trough the 
>subroutine, the undef command causes a segmentation fault.  Any 
>clues?  Thanks.

Can you tell us which version of perl you're using and which platform it's
on, and maybe a little more detail such as code snippets?  

  perl -v

will report the version of perl, and in recent perls

  perl -V

will give more information.  If you have a recent development version of
perl (5.003_27 is fairly recent...) then you might consider using the
perlbug program to report the problem.  If you're running an old 5.003_xx
then try getting the latest version and seeing if the problem's already
resolved.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 19 Feb 1997 13:40:21 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Simple DBM question
Message-Id: <5eevs5$h9u@fridge-nf0.shore.net>

Brian (signal@netjam.net) wrote:

: This is fine.  But I am stuck with the problem that I have files already
: in .pag and .dir format, and I don't know how to read those using
: dbmopen().  Did the functionality of dbmopen change since that book was
: written?  How can I read in .pag and .dir dbm files?

If you've gotten the .dir/.pag files from the same type of system
(Ex: Linux<->Linux), you can always do:

dbmopen(%HASHNAME, "dbname", permissions) || die("NO: $!\n");
etc.  You don't use extensions, here - dbname stands for the basename
of the db you will be opening.

The following contains a lot of speculation, so please bear with me...

If I'm correct, you can configure your version of dbm to create .dir
and .pag files.  Mine does/did .db by default, but I changed that.  My
understanding of dbm, particularly between platforms leads me to believe
that one can't *directly* port a, say, SUN OS 4.1.3 gdbm file to Linux 
gdbm, because of the little endian system.  If this is the case, you
might write a script to convert SUN OS 4 gdbm files to Linux, using
pack and unpack.  Bear in mind that this is only an off-centered
theory, as I haven't had my coffee, yet.  :-)

--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"


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

Date: 19 Feb 1997 14:13:12 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Substitute question
Message-Id: <slrn5gm2ej.hk3.dave@fast.thomases.com>

On 18 Feb 1997 13:06:43 -0800, Jim Harkins <t_jharki@qualcomm.com> wrote:
> I've got a bunch of lines with the following format:
> 
> word foo word { (maybe word) bar blatz more_words
> 
> Given the 2 input words foo and bar, I want to either return the value of
> blatz, or modify the string to replace blatz with something else.  The first
> key (foo) is always the second word of the line.  After I find foo I want
> the opening '{', then I want to look for the second key (bar).  The word 
> after the second key is the word of interest.  foo and bar could be the
> same word.

Untested but, how about

     m/^\w+\s+foo\b.*?{.*?\bbar\s+(\w+)\b/;
     
       Match a word after beginning of line, then skip spaces, then
       match 'foo' followd by a word boundary. Then skip cautiously forward
       until you reach a '{'. Then skip until you get the text 'bar', ignore
       some more spaces then same the word of interest in $1.
       
Of course 'foo' and 'bar' can be variables if you want!

The substitute could you the same patterns, you'll just have to remember the
rest of the text in the pattern.

Regards

Dave


-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 19 Feb 1997 07:54:18 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: Verne_Beck@mindlink.bc.ca (Verne Beck)
Subject: Re: subtle (to me) RE problem
Message-Id: <JFRIEDL.97Feb19165418@tubby.nff.ncl.omron.co.jp>


[mail and post]

Verne Beck <Verne_Beck@mindlink.bc.ca> wrote:
|> > In a script which is scoring spam, I want to be able to
|> > detect N or more occurances of any one of these characters:
|> > 
|> > 	()!%*_+=|\/,<>:~-
|
|>   m#[()!%*_+=|/\,<>:~-]{7,}#
|> 
|> OK, this is only a guess. :-)
|> 
|> What I am trying to do is to set up a class of characters (everything
|> inside the square braces, followed with a set of curly braces to set
|> up the mininum number of matches as seven.
|> 
|> Will this work? (I am already home for the weekend, so I can't test
|> the code).
|> 
|> PS Since the special characters are enclosed entirely inside the
|> square braces, I am assuming that I wouldn't need to 'escape' them.

Remember, a character-class metacharacters are unrelated to other
regex metacharacters (and all are unrelated to doublequotish string
metacharacters).

Outside of a charactar class, \ [ ( ) * { } | are special (and probably a
few I've forgotten). Within a character class, \ and ] are special, with ^
and - being special depending upon the position (well, ] is special
depending on the position, too -- it's not special if first).

And, of course, when used where variable interpolation can happen, $ and @
(and perhaps [ and {) are always special.

(And, of course, the regex delimiter(s) is/are always special).

Anyway, back to:

|>   m#[()!%*_+=|/\,<>:~-]{7,}#

Since \ is special within a class, you'd need to escape it.
Also, using the {7,} will allow the class to match seven times.
It will, for example, match
	=+==*+=+=!=

This is perhaps a fine thing to want to do, but is not what the original
poster wanted (he wanted to know if any particular character appeared seven
or more times on a single line). One way to do it with a regex, as many have
pointed out, is with
	([....]).*\1.*\1.*\1.*\1.*\1.*\1.*\1
or
	([....])(?:.*\1){7}

or the like. They're not really very efficient, though. It might well be
easier to just use a bunch of tr// to count occurances.

	Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
See my Jap<->Eng dictionary at http://www.wg.omron.co.jp/cgi-bin/j-e
O'Reilly's Regular Expression book: http://enterprise.ic.gc.ca/~jfriedl/regex/




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

Date: Wed, 19 Feb 1997 12:38:47 +0000
From: Henry Whyte <hwhyte@translation-plus.co.uk>
Subject: Re: transliteration library
Message-Id: <qZ5uONAXRvCzEwxT@translation-plus.demon.co.uk>

In article <330A71CC.EAA@worldnet.att.net>, Anne Hilllebrand <annehilleb
rand@worldnet.att.net> writes
>grab a tarred bundle of
>>  files from http://www.cwi.nl/ftp/stijnvd/, file TRANSLITERATION.tar.uu
>> 
>>         Kind regards,
>> 
>>                 Stijn van Dongen
>
>Wul, buddy - here in thuh South we'd be apt to say you muss have a lotta
>time onyer hans to be doin sumpthin like that! Gudluck!
Why, he done seyyid he wuz tarred.
-- 
Henry Whyte, Translation Plus                translation-plus@07000.net
hwhyte@translation-plus.co.uk                 Phone/fax +44 1382 200304
http://www.translation-plus.demon.co.uk/          Mobile +44 802 818180
For translations into English from French, German, Russian and Spanish.


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

Date: Wed, 19 Feb 1997 13:59:57 GMT
From: llambros@mcs.net (Louis Lambros)
Subject: Win32::EventLog on NT
Message-Id: <330b06e9.479998625@news.mcs.net>

I am having problems getting an EventLog dump program to
work properly.  Does anyone have an example using this
package?  I am using build 303 of the NT distribution.

Thanks in advance.


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

Date: 19 Feb 1997 13:56:44 GMT
From: "Roth Consulting" <rothd@roth.netX>
Subject: Re: Win32::ODBC  $db->close()
Message-Id: <01bc1e6c$54807fe0$0100a8c0@www>



Sameh R Boutros <boutros+@andrew.cmu.edu> wrote in article
<In2Hata00iWn0Lmkg0@andrew.cmu.edu>...
> here is the code:
> 
> use Win32::ODBC;
> $db = new Win32::ODBC("cochran");
> $stmt = "SQL here";
> $db->sql($stmt);
> $db->close();
> 
> 
> when i run the following code, the data is inserted, BUT, the last line
> [$db->close();] causes the following error:
> 
> Goto undefined subroutine &AutoLoader::AUTOLOAD at
> D:\dev\perl5\lib/Win32/ODBC.pm line 861. 
> 
> 
> 
> when i comment the last line out, it seems to run ok....but i am
> supposed to close the connection
> 
> 
> BTW this is in a CGI on WinNT4 IIS 3 and perl 5.001 (1m) on intel

The syntax is wrong. Try:
	$db->Close();
Notice the capital 'C'.

dave


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 97)
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.  

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.

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 V7 Issue 973
*************************************

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