[13226] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 636 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 25 09:08:39 1999

Date: Wed, 25 Aug 1999 06:05:11 -0700 (PDT)
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, 25 Aug 1999     Volume: 9 Number: 636

Today's topics:
        ** REQUEST FOR A SCRIPT ** <kilimount@earthling.net>
        A nice tough RegEx for u to solve..? <pdobbs@home.com>
    Re: A nice tough RegEx for u to solve..? (Lack Mr G M)
        A simple newsreader engmark@techtradeinter.se
    Re: A simple newsreader (Marcel Grunauer)
    Re: Briles' Law <jnuse@pwshift.com>
        Connecting a Informix-DB running under NT from Linux <oliver_thinnes7845@my-deja.com>
    Re: DBI:mysql error: install_driver (mysql) failed <rhrh@hotmail.com>
        dbmopen (Raymond Ip)
        extract text <mzh@cntw.com>
    Re: extract text (Marcel Grunauer)
    Re: extract text <mzh@cntw.com>
    Re: extract text (Marcel Grunauer)
    Re: Hex from a file (Bart Lateur)
        how print a string as hex? (Helmut Richter)
        Module/Scripts for searching text? asim@my-deja.com
    Re: mysql interview <contact@nativetongues.com>
    Re: Perl a Black Sheep? <Mark@Mark.Com>
        perl Ad <One.Bored.Guru........@p0.f1.n30.z30.fidonet.org>
        Perl ISAPI and MSSQL nr42@my-deja.com
    Re: Perl Module Installation (marc)
    Re: Perl won't compile (gcc 2.8, AIX) <r3564c@email.mot.com>
    Re: POP is pooped! (Bart Lateur)
        Q: Perl to binary? <a_t_r@dds.nl.NOSPAM>
    Re: Q: Perl to binary? (Sam Holden)
    Re: Q: Perl to binary? <a_t_r@dds.nl.NOSPAM>
    Re: Q: Perl to binary? (Sam Holden)
    Re: recovering the query string while using CGI.pm gmahler@my-deja.com
        rename with ActivePerl (Christophe Oddo)
    Re: Script to delete 'What's New' entries over 30 days  (Bart Lateur)
        Search IMDB using Perl <thomas@bibsyst.no>
        Sorting a list of lists <djten@sisna.com>
    Re: Sorting a list of lists <julien.quint@xrce.xerox.com>
    Re: Sorting a list of lists (Eric Bohlman)
    Re: Win32::OLE to read Word file <andrewf@beausys.freeserve.co.uk>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 25 Aug 1999 12:32:29 +0200
From: kilimount <kilimount@earthling.net>
Subject: ** REQUEST FOR A SCRIPT **
Message-Id: <37C3C63D.8775204C@earthling.net>

Being from now totaly incapable of writing one, I'm searching for a
script that would calculate details on mortgages.
The most complex, the best.
If ever anyone as one to give away, that B cool :O)
Thanx in advance,

Kilimount.



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

Date: Wed, 25 Aug 1999 10:56:52 GMT
From: Paul Dobbs <pdobbs@home.com>
Subject: A nice tough RegEx for u to solve..?
Message-Id: <37C3CE04.F7105410@home.com>

s/[\">]?(\S{40,})[<\/A>]?/substr($1,0,39)."
".substr($1,39)/ieg;

The desire is to grab all the text between in a large string
but only
at those spots in the string where the text is between ">
and </A> AND
only if the string is 40 or more characters, and then split
that text
up with a single blank space.

EG:
file.html">FileNumber1234567890123456789012345678901234567890</A>
Should become
file.html">FileNumber12345678901234567890123456789
01234567890</A>
But right now file.html">FileNumber123456789012345678
9012345678901234567890</A>

 What is my mistake? Why won't it stick to just the defined
section of text?


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

Date: Wed, 25 Aug 1999 12:17:05 BST
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: A nice tough RegEx for u to solve..?
Message-Id: <1999Aug25.121705@ukwit01>

In article <37C3CE04.F7105410@home.com>, Paul Dobbs <pdobbs@home.com> writes:
|>
|> The desire is to grab all the text between in a large string  but only
|> at those spots in the string where the text is between "> and </A> AND
|> only if the string is 40 or more characters, and then split that text
|> up with a single blank space.
|>
|> s/[\">]?(\S{40,})[<\/A>]?/substr($1,0,39)." ".substr($1,39)/ieg;
|> 
|>  What is my mistake? Why won't it stick to just the defined
|> section of text?

   [\">]? allows for '0 or 1' occurences, and it is 0 that gets matched.
   Remove the '?' (in fact. move *both* of them!).
   Also, both 39's should be 40 if you want to split after 40 chars.

   However: 

s/[\">](\S{40})(.*?)[<\/A>]/$1 $2/g;

will do what you want (you just get the regexp to pick out the first 40
chars for you - and use .*?  to pick up the rest in a non-greedy
fashion). 


-- 
--------- Gordon Lack --------------- gml4410@ggr.co.uk  ------------
This message *may* reflect my personal opinion.  It is *not* intended
to reflect those of my employer, or anyone else.


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

Date: 25 Aug 1999 09:39:57 GMT
From: engmark@techtradeinter.se
Subject: A simple newsreader
Message-Id: <7q0dld$ksk$1@zingo.tninet.se>
Keywords: PERL NEWSREADER

Good day.
I would be most thankful if someone could post a small perl-script,
that connects to a given news-server, and gets a given message
from a given news-group; without any additional tools.
Just to show me the basics.
Please?

Thanks,
Henrik Engmark



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

Date: Wed, 25 Aug 1999 11:27:05 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: A simple newsreader
Message-Id: <37c5e0e2.916097@news>

On 25 Aug 1999 09:39:57 GMT, engmark@techtradeinter.se wrote:

>Newsgroups: comp.lang.perl.misc
>Subject: A simple newsreader
>Followup-To: comp.lang.perl

Why did you set the follow-up to comp.lang.perl, a newsgroup which
doesn't even exist anymore? Just leave that header field out.

> I would be most thankful if someone could post a small perl-script,
> that connects to a given news-server, and gets a given message
> from a given news-group; without any additional tools.
> Just to show me the basics.

I hope by "without any additional tools" you don't mean "without any
modules".

Have a look at the Net::NNTP module. It will do what you want. Instead
of posting an example, it will be more helpful for you to read the
module's documentation.

If you are using ActiveState Perl on NT (just guessing from your
post's headers), you can install libnet (which contains Net::NNTP) by
using the ppm

C:> ppm
ppm> install libnet

The Perl Cookbook also contains an example of how to do this (Recipe
18.4: Reading and Posting Usenet News Messages)


Marcel
Perl Padawan
-- 
sub AUTOLOAD{($_=$AUTOLOAD)=~s,^.*::,,;y,_, ,;print} Just_Another_Perl_Hacker();


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

Date: Wed, 25 Aug 1999 06:50:06 -0400
From: "Jane Nuse" <jnuse@pwshift.com>
Subject: Re: Briles' Law
Message-Id: <6_Pw3.23523$x04.1400963@typ11.nn.bcandid.com>

yeah, programmers are just too cool


Tom Briles wrote in message <37C31145.8E9753DF@texas.net>...
>The quality of questions and answers in c.l.p.misc is inversely
>proportional to the number of Perl programmers attending conferences.
>
>- Tom




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

Date: Wed, 25 Aug 1999 11:33:58 GMT
From: Oliver Thinnes <oliver_thinnes7845@my-deja.com>
Subject: Connecting a Informix-DB running under NT from Linux
Message-Id: <7q0kb6$kki$1@nnrp1.deja.com>

Hallo.

I'm not familiar with perl. I read any information about DBI and
Informix.

Is there any chance to connect Informix Online Dynamic Server 7.2
running under MS NT 4.0 from Linux over TCP/IP?

Which programs are necessary?

Thank you in advance.

Oliver Thinnes


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 25 Aug 1999 09:12:46 +0100
From: Richard H <rhrh@hotmail.com>
Subject: Re: DBI:mysql error: install_driver (mysql) failed
Message-Id: <37C3A57E.992AC1AC@hotmail.com>

tjcox@my-deja.com wrote:
> 
> Hello!
> 
> I am taking over a system which has
> FreeBSD 2.22
> MySQL 3.22.16 (binary dist. for FreeBSD)
> DBI 1.06
> DataDumper 2.10
> DataShowTable 3.3
> Msql-Mysql-modules 1.2017
> Perl 5.004
> 
> and trying to get a web application to access the Mysql db.
> All command line and mysql utilities work fine.  Perl itself
> works fine.
> 
> But.......
> 
> when attempting to connect in the perl code it gives the following error
> during the
> 
> dbh$->connect("DBI:mysql:$mydb",.....
> 
> -----------
> install_driver(mysql) failed: Can't load
> '/usr/local/lib/perl5/site_perl/i386-fr eebsd/auto/DBD/mysql/mysql.so'
> for module DBD::mysql: Undefined symbol "___sstderr" in
> perl:/usr/local/lib/perl5/site_perl/i386-
> freebsd/auto/DBD/mysql/mysql.so
> at /usr/local/lib/perl5/i386-freebsd/5.004/DynaLoader.pm line 155.
> 
>  at (eval 1) line 2
> 
>  at test.cgi line 36
> -----------
> 
> Upon reviewing many a posting by you guys and searching the
> documentation, mainly the README in the Msql-Mysql-modules directory
> these are what we have looked into:
> 
> 1.  The README suggests this error is caused by Perl being compiled in
> something other than gcc.  We have checked our perl (perl -V) and it
> looks as if gcc (version 2.7.2.1) was used during compilation.  It
> assures us that Binary distributions of Mysql are done in gcc.  Thus,
> this doesn't seem to be the problem.
> 
> 2.  Other documentation, here, stated a solution was to go to the Msql-
> Mysql-modules directory and recompile (tar,perl Mak.., make, make test,
> ..).  This did not work and further the make test gives us the same
> error.
> 
> 3.  We have tried the newer version Msql-Mysql-modules-1.2200.tar.gz
> and this gave us the same error.
> 
> Help??
> Does anyone have suggestions or seen this before?
> 
> The next step we can think of is to get the newest versions of gcc,
> Perl, Mysql and on down the line and hope it works, but there must be a
> way to fix this.
> 
> Thanks in advance,
> TJ
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

get yourself over to the dbi-users list, which may be more help

http://www.isc.org/dbi-lists.html

Richard H


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

Date: 25 Aug 1999 11:35:03 GMT
From: rwmip@glink.net.hk (Raymond Ip)
Subject: dbmopen
Message-Id: <7q0kd7$9pd$1@unix2.glink.net.hk>

Can I tell perl to use dbmopen to open xx.db instead of xx.page, xx.dir
I'm running on SunSparc 7


Best regards

Raymond Ip



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

Date: Wed, 25 Aug 1999 14:03:38 +0200
From: "michael hagberg" <mzh@cntw.com>
Subject: extract text
Message-Id: <7q0iei$34u$1@news3.global-ip.net>

is there any function like the substr that makes it possible to say "extract
from this point to this". I've looked everywhere but cant find anything like
this, ie there any or should I just write the extraction myself?

Mick





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

Date: Wed, 25 Aug 1999 11:16:42 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: extract text
Message-Id: <37c3de79.299991@news>

On Wed, 25 Aug 1999 14:03:38 +0200, "michael hagberg" <mzh@cntw.com>
wrote:

> is there any function like the substr that makes it possible to say "extract
> from this point to this". I've looked everywhere but cant find anything like
> this, ie there any or should I just write the extraction myself?

Where did you look? You've already found it: substr

perldoc -f substr


Marcel
Perl Padawan
-- 
sub AUTOLOAD{($_=$AUTOLOAD)=~s,^.*::,,;y,_, ,;print} Just_Another_Perl_Hacker();


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

Date: Wed, 25 Aug 1999 15:05:55 +0200
From: "michael hagberg" <mzh@cntw.com>
Subject: Re: extract text
Message-Id: <7q0l57$4ln$1@news3.global-ip.net>

problem is, I never know the length. I DO know between which characters I
want to extract the text from. So I want to say like
substr(EXPR,OFFSET,FROM,TO) where form and to is the boundaries. I dont see
how to do that with the help of substr... or am I just blind?

Mick

Marcel Grunauer wrote in message <37c3de79.299991@news>...
>wrote:
>
>
>Where did you look? You've already found it: substr
>
>perldoc -f substr





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

Date: Wed, 25 Aug 1999 12:38:11 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: extract text
Message-Id: <37c6f0d6.5000790@news>

On Wed, 25 Aug 1999 15:05:55 +0200, "michael hagberg" <mzh@cntw.com>
wrote:

> problem is, I never know the length. I DO know between which characters I
> want to extract the text from. So I want to say like
> substr(EXPR,OFFSET,FROM,TO) where form and to is the boundaries. I dont see
> how to do that with the help of substr... or am I just blind?

Well, there's index, with which you can find out where a character
occurs in a string.

perldoc -f index

You can combine that with substr to do your extraction.

For more complex situations you might want to use regular expressions.
They are very well explained in "Learning Perl" and "Programming
Perl", or in perlre, which came with your Perl installation.

perldoc perlre

If you don't know about regular expressions yet, you've missed out on
one of Perl's best features, so it's worth knowing them inside out.

Good luck.


Marcel
Perl Padawan
-- 
sub AUTOLOAD{($_=$AUTOLOAD)=~s,^.*::,,;y,_, ,;print} Just_Another_Perl_Hacker();


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

Date: Wed, 25 Aug 1999 07:14:43 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Hex from a file
Message-Id: <37c79018.3037297@news.skynet.be>

Jörg Oliver Pinn wrote:

>how can I read hex-values from a file?

Huh? You want to read

	41 42 43

and convert it to "ABC", or the exact reverse?


 ->
	$_ = '41 42 43';
	print pack 'C*', map { hex } /([0-9A-Fa-f]{2})/g;
 <-
	$_ = 'ABC';
	print join ' ', map { sprintf '%02X', ord } split //;

	Bart.


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

Date: 25 Aug 1999 12:19:15 GMT
From: Helmut.Richter@lrz-muenchen.de (Helmut Richter)
Subject: how print a string as hex?
Message-Id: <7q0n03$mo8$1@sparcserver.lrz-muenchen.de>

I want to convert a string to hex. The solution I have come up with is
the second line below but I suspect that this is unnecessarily
complex.  Is there a simpler way to do it?

$x = "abc\376";
$y = join ('', map (sprintf ("%2.2x", ord($_)), split (//, $x)));
print "$y\n";

Helmut Richter


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

Date: Wed, 25 Aug 1999 12:52:41 GMT
From: asim@my-deja.com
Subject: Module/Scripts for searching text?
Message-Id: <7q0oui$nsd$1@nnrp1.deja.com>

Hi folks,

	I'm looking around the Internet for a good solution for an
intriguing situation. I'm needing to develop indexing/searching for a
couple of mailing lists I'm on. I'm planning to start work on this soon,
and I might be running one from my site.
	What I'm looking for is a Perl module/script that will do the
indexing and searching, and I would like it Open Source, so that I can
add some features I suspect aren't in most other software of this type.
I will have the mail as flat files in directories, most likely, so it
would be much like indexing HTML, but I'd prefer not to run through
something like Excite Search or Hotbot. For instance, one of the lists's
digest's that I'll be getting data from exists only in huge 100k+ chunks
of files. If they cannot be parsed out, I'll have to edit the search
engine code to "break out" the exact mail message from the surrounding
text (that snippent of code has already been written). If it runs from
my new ISV, they run
Linux, and I'm allowed Perl, PHP and MYSQL -- I don't know if they'd
like another binary running.
	I have seen and tested out ICE (http://ice.cornell-iowa.edu/),
and seen the Inverted Searching modules on CPAN, and checked out
programs like Links and others from the references on the newsgroup from
eariler this month. I'm just looking for all possible solutions, and
personal recommendations. Any help would be appreciated, thanks!


					----Woody Hill


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 25 Aug 1999 09:35:56 +0100
From: "Martin" <contact@nativetongues.com>
Subject: Re: mysql interview
Message-Id: <7q09vj$381$2@gxsn.com>

And it covers a lot of stuff from DBI to PHP3 and more. It's also very
readable...

Martin

Makarand Kulkarni <makkulka@cisco.com> wrote in message
news:37C36944.2BB77495@cisco.com...
> [ barrytownbb@yahoo.com wrote:
>
> > I wanted to get a headstart on essential reading for being "tech-ed out"
>
> A new book is now out --
> MySQL and mSQL (Nutshell Series)
> by Randy Jay Yarger, George Reese, Tim King
>
> There is some good docs you could read at www.Mysql.com
> --
>




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

Date: Wed, 25 Aug 1999 11:58:27 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: Perl a Black Sheep?
Message-Id: <37C3CC53.41AA7C0B@Mark.Com>



joeyandsherry@mindspring.com wrote:

>
>
> I spoke to the admissions counselor and I questioned which training program
> would best enhance my limited exposure to NT. The Counselor introduced me to
> the Training Director, partly to answer my question and partly for
> prequalification...He asked of my experience.
>
> I told him of my learning of Perl and of how I used it, etc. As soon as I
> mentioned Perl and the UNIX server I use, he snarled. It was if I was
> speaking of a plague...He commented that Perl was not a "real" programming
> language, it is a scripting language and offered his dissertation on
> programming and Unix and other such things.

It's simple really. Your training director is a complete gobsh**te. I guess if I
was trying to flog
worthless Microsoft certifications, I would rubbish the opposition too.

I'd be interested in what his definition of a REAL PROGRAMMING LANGUAGE is.
Actually, I wouldn't, he probably thinks VB script is the sine qua non of the
programming world. Tosser!



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

Date: Wed, 25 Aug 1999 00:01:54
From: "One Bored Guru        " <One.Bored.Guru........@p0.f1.n30.z30.fidonet.org>
Subject: perl Ad
Message-Id: <000023e4@madnet.net>

Attention Perl-5/Linux Programmers.

The Sync3 Developement Team is looking for Perl-5/Linux programmers
to help on an open source project writing a new type of bbs designed
for Linux and The Internet.  If you think you have the skill and are
interested, please send email to devteam[at]sync3.com indicating your
interest and providing us with the relevant details pertaining to
your skill level and previous experience.  Thank you for your time
and interest.

     Steve Byers,
     Project Administrator,
     The Sync3 Project.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        + The Talamasca Internet Newsgroup Gateway +
               telnet://talamasca-bbs.com


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

Date: Wed, 25 Aug 1999 07:16:13 GMT
From: nr42@my-deja.com
Subject: Perl ISAPI and MSSQL
Message-Id: <7q057o$a6l$1@nnrp1.deja.com>

Hi!

I have a strange problem. I'm trying to use MSSQL:Sqllib under Perl for
ISAPI on a Windows NT server (SP3) running IIS3.0 but I can't seem to
get it to work properly. The strange thing is, the first time I run it
it works fine, second time not at all! Always! First time works and then
it's dead untill I reset the server. It always works from the
commandprompt.

I use latest version of Perl (5.19) and the SQLlib from:
http://www.algonet.se/~sommar/mssql/

Anybody have had similar problems? Solutions?

/Magnus


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 25 Aug 1999 12:08:10 GMT
From: marc@oscar.noc.cv.net (marc)
Subject: Re: Perl Module Installation
Message-Id: <slrn7s7n29.2jn.marc@oscar.noc.cv.net>

In article <7q004q$6sf$1@nnrp1.deja.com>, polarbear wrote:
>Hi,
>
>Thank you for your response. In this case, do you suggest I re-install
>Perl on my system?
>
>Regards.
>

yes

Good luck

marc

>
>In article <37C2DEBB.B72F23D0@mail.cor.epa.gov>,
>  David Cassell <cassell@mail.cor.epa.gov> wrote:
>> polarbear wrote:
>> >
>> > Hi,
>> >
>> > I am trying to install the perl module, POP3Client, and when I did a
>> > 'make install', it gives me the following error message,
>> >
>> > Perl lib version (5.00502) doesn't match executable version
>(5.00503)
>> [snip]
>>
>> It looks like your lib version is 5.005_02 while your
>> Perl is 5.005_03.  Make sure everything is up to date,
>> like your Perl version is.
>>
>> David
>> --
>> David Cassell, OAO                     cassell@mail.cor.epa.gov
>> Senior computing specialist
>> mathematical statistician
>>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.


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

Date: Wed, 25 Aug 1999 09:25:31 +0200
From: Dermot McNally <r3564c@email.mot.com>
Subject: Re: Perl won't compile (gcc 2.8, AIX)
Message-Id: <37C39A6B.716258@email.mot.com>



Kent Perrier wrote:
> 
> Chris Covington <ccoving@uhc.com> writes:
> 
> > I am trying to compile perl5.005_03 on AIX 4.3.2 using gcc 2.8.1.
> >
> 
> I don't know if this has anything to do with your problem, but I have
> had problems building perl on AIX that isn't statically linked, when
> I used gcc (and egcs).

Well, I can help you there - you just need to change the manner in which
you run configure. Here's the correct command line:

sh Configure -Dcc=gcc

You might expect that, since Configure always spots that gcc is running,
you wouldn't need to do this (I certainly did). Nonetheless, it appears
that only when you spell things out will the correct hints set be
selected.

Regarding the AIX 4.3.2 and gcc 2.8.1 mix, I was under the impression
that this version of gcc simply didn't work to any useful extent on AIX
4.3. I always had to use egcs. I've just installed gcc 2.95 (which does
support AIX 4.3), and while it compiles perl, a stack of tests fail (see
my other post on this subject, anyone who thinks they can tell me why).

Cheers,
Dermot


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

Date: Wed, 25 Aug 1999 07:14:41 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: POP is pooped!
Message-Id: <37c68e2e.2546652@news.skynet.be>

Randal L. Schwartz wrote:

>Alan> Yes, I was trying to make that point to a student recently, and then
>Alan> noticed to my surprise that Merlyn's Web techniques articles are all
>Alan> using numbers:
>
>Alan> http://www.stonehenge.com/cgi/wtsearch?search=flock
>
>Alan> Comments?
>
>Well, I think the chance of those numbers changing is pretty small.

But the constants are not necessarily garanteed to be the same value on
all platforms. If you want cross-platform portability, go for the
symbolic constants.

And no, I don't have any examples, for the moment. ;-)

Oh, BTW, I use the numbers myself. :-)

If you need both the flock and the 0_* constants, using the module is
annoyingly complicated:

	use Fctnl qw(:DEFAULT :flock);

If you forget ":DEFAULT", you don't get the O_* constants. Arrgh! And I
always forget it's exact spelling. Then this is easier:

	use Fcntl;
	use Fcntl ':flock';

	Bart.


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

Date: Wed, 25 Aug 1999 11:09:33 +0200
From: andre <a_t_r@dds.nl.NOSPAM>
Subject: Q: Perl to binary?
Message-Id: <37C3B2CD.BEE8E75F@dds.nl.NOSPAM>

Hi perl experts,

I have a question over perl.
Is it possible to convert perl script to a binary ?
Which program do you use for converting ?

I will use binary's for performance reason..

Grtnx,

Andre



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

Date: 25 Aug 1999 09:40:38 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Q: Perl to binary?
Message-Id: <slrn7s7ehs.jjl.sholden@pgrad.cs.usyd.edu.au>

On Wed, 25 Aug 1999 11:09:33 +0200, andre <a_t_r@dds.nl.NOSPAM> wrote:
>Hi perl experts,
>
>I have a question over perl.
>Is it possible to convert perl script to a binary ?
>Which program do you use for converting ?

Why don't you read the FAQ that comes with perl for your answer...

>I will use binary's for performance reason..

In that case you should read the FAQ and then not bother, because it won't
help the performance at all.


-- 
Sam

comments on data are usually much more helpful than on algorithms
	--Rob Pike


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

Date: Wed, 25 Aug 1999 12:09:41 +0200
From: andre <a_t_r@dds.nl.NOSPAM>
Subject: Re: Q: Perl to binary?
Message-Id: <37C3C0E5.5A246E8F@dds.nl.NOSPAM>

In the faq there is nothing that tell how hou make that binary.. only the
difference between a binary and a perl script..


andre

Sam Holden wrote:

> On Wed, 25 Aug 1999 11:09:33 +0200, andre <a_t_r@dds.nl.NOSPAM> wrote:
> >Hi perl experts,
> >
> >I have a question over perl.
> >Is it possible to convert perl script to a binary ?
> >Which program do you use for converting ?
>
> Why don't you read the FAQ that comes with perl for your answer...
>
> >I will use binary's for performance reason..
>
> In that case you should read the FAQ and then not bother, because it won't
> help the performance at all.
>
> --
> Sam
>
> comments on data are usually much more helpful than on algorithms
>         --Rob Pike



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

Date: 25 Aug 1999 10:45:06 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Q: Perl to binary?
Message-Id: <slrn7s7iao.o0o.sholden@pgrad.cs.usyd.edu.au>

On Wed, 25 Aug 1999 12:09:41 +0200, andre <a_t_r@dds.nl.NOSPAM> wrote:

<answering my post jeopardy style>
>In the faq there is nothing that tell how hou make that binary.. only the
>difference between a binary and a perl script..

You think so do you...

=head1 Found in /usr/lib/perl5/5.00502/pod/perlfaq3.pod

=head2 How can I compile my Perl program into byte code or C?

Seems to cover it to me...

Here's a snippet :

In general, the compiler will do nothing to make a Perl program smaller,
faster, more portable, or more secure.  In fact, it will usually hurt
all of those. 

<snip entire previous post quoted>
>> --
>> Sam
>>
>> comments on data are usually much more helpful than on algorithms
>>         --Rob Pike

Your software is broken, it should remove my sig. Even so you should delete
it yourself.

Don't quote the whole post, and don't quote it after your input. It's very
unusual for English and makes it hard to understand.

-- 
Sam

PC's are backwards ... throw them out! Linux is ok though.
	--Rob Pike (on the subject of CR/LF etc)


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

Date: Wed, 25 Aug 1999 08:54:30 GMT
From: gmahler@my-deja.com
Subject: Re: recovering the query string while using CGI.pm
Message-Id: <7q0b04$es3$1@nnrp1.deja.com>

In article <37C083DD.9FBD1373@vpservices.com>,
  Jeff Zucker <jeff@vpservices.com> wrote:
>
> Say what???  The original poster had the "use" syntax a bit off, but
> certainly the query string can be gotten easily with CGI.pm.  This
code
> prints "[x=y&j=k]" when called from a browser as "test.cgi?x=y&j=k" or
> when called from the command line as "test.cgi x=y&j=k".
>
> #!/usr/local/bin/perl -wT
> use strict;
> use CGI qw(:standard);
> my $x = query_string() || '';
> print header, "[$x]";
>
> From _Official_Guide_to_Programming_with_CGI.pm, page 224.
> "query_string() ... returns the raw, unprocessed, query string from
the
> current Web request."

When I try the above code, I get an error:

Can't call method "param" without a package or
object reference at (eval 2) line 4.

Maybe my Perl interpreter is deficient, but like
I mentioned before, I thought query_string() is
a method of the CGI class, and so must be associated
with a CGI object to be called, say like this:

use CGI qw(:standard);
CGI x;
print x->query_string();

Now, I only started programming in Perl last week
(not by choice!) so I'm not sure about what I'm doing.
I do have Perl5, and I'm on SunOS.  Why does this
work on Other People's Perl?

Greg



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 25 Aug 1999 12:01:27 GMT
From: 2002@antispam.calva.net (Christophe Oddo)
Subject: rename with ActivePerl
Message-Id: <37c3dad9.500936@news.calvacom.fr>

Hi group,

Using the last release of ActivePerl (Win 32), I need to rename a file
in a program, by:
          rename($filename,$newname);

It fails every time, with the following error message:
          Permission denied

What is the problem?
Have I to specify something to W98, in order to allow renaming?
Or am I wrong in syntax? (i take example on 'Learning Perl 2nd ed,
p.26).

Thank you in anticipation for answering.
Christophe

(If you want to reply by mail, delete 'antispam.' in the adress)


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

Date: Wed, 25 Aug 1999 07:14:45 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Script to delete 'What's New' entries over 30 days old.
Message-Id: <37c89253.3607858@news.skynet.be>

dkp01@my-deja.com wrote:

>Somehow in this process any
>current enteries which are over 30 days old should not be included in
>the new page. I have created the form and there is a date field, but I
>am not sure how Perl handles dates for comparison.

Define "entry". If it's the age of a file, look at "-M" and related
functions (It's under "*-X*" in perlfunc, but for some reason PERLDOC
doesn't find it.) It returns the age of a file in days, since the time
the script started.

For other functions, Perl sees dates as a number of seconds since some
epoch (1st of jan 1970, or 1st of 1904 on a Mac). 30 days is 30*24*60*60
seconds.

	Bart.


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

Date: Wed, 25 Aug 1999 14:09:34 +0200
From: Thomas Weholt <thomas@bibsyst.no>
Subject: Search IMDB using Perl
Message-Id: <37C3DCFE.10810A2E@bibsyst.no>

Hi,

Has anybody tried to use perl to search imdb ( International Movie
Database ) either online or by downloading the entire database files?
There are info about interfaces at www.imdb.com/interfaces but it`s in c
and I was wondering if anybody had made a module for this purpose??

Thomas Weholt,
Norway


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

Date: Tue, 24 Aug 1999 21:17:47 -0600
From: "DJ" <djten@sisna.com>
Subject: Sorting a list of lists
Message-Id: <37c3603e@news.sisna.com>

I've been using an SQL-Lite kind of module named Sprite for some simple
database tasks.  It does not have ORDER BY functionality on the SELECT,
which I have not needed ...  until now.  The SELECT returns a list of lists
(columns and rows that match the SELECT criteria), and I typically use it as
below.  In my example I have the SELECT assigned to a variable named "data."

foreach $row (@$data) {
   ($field1, $field2, $field3, $field4) = @$row;
   (  ...  do stuff with the individual fields here  ... )
}

If I had ORDER BY capability, I would order by field3.  I've been trying to
figure out code that will do a sort that will achieve the same result.  I
was hoping... actually been _trying_ to get some implementation of the
Schwartzian Transform to work, but have so far failed.  Might be on the
wrong track.  I'm thinking this has to have been dealt with before, and that
someone must have a recipe, or something, that will perform a sort on a list
of lists, based upon one element of the list within the list.





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

Date: Wed, 25 Aug 1999 14:41:16 +0200
From: Julien Quint <julien.quint@xrce.xerox.com>
Subject: Re: Sorting a list of lists
Message-Id: <37C3E46C.603177AA@xrce.xerox.com>

DJ wrote:
> 
> I've been using an SQL-Lite kind of module named Sprite for some simple
> database tasks.  It does not have ORDER BY functionality on the SELECT,
> which I have not needed ...  until now.  The SELECT returns a list of lists
> (columns and rows that match the SELECT criteria), and I typically use it as
> below.  In my example I have the SELECT assigned to a variable named "data."
> 
> foreach $row (@$data) {
>    ($field1, $field2, $field3, $field4) = @$row;
>    (  ...  do stuff with the individual fields here  ... )
> }
> 
> If I had ORDER BY capability, I would order by field3.  I've been trying to
> figure out code that will do a sort that will achieve the same result.  I
> was hoping... actually been _trying_ to get some implementation of the
> Schwartzian Transform to work, but have so far failed.  Might be on the
> wrong track.  I'm thinking this has to have been dealt with before, and that
> someone must have a recipe, or something, that will perform a sort on a list
> of lists, based upon one element of the list within the list.

You can use the sort function with a subroutine that will compare the
third field of every entries. This will look like:

	@sorted = sort { $a->[2] <=> $b->[2] } @data;

Of course, replace '<=>' with the correct comparison operation if you're
not sorting numbers. Here is a little example:

	> perl
	@data = ([1, 1, 3, 1], 
        	 [2, 2, 5, 2],
	         [3, 3, 1, 3],
	         [4, 4, 4, 4],
	         [5, 5, 2, 5],
	        );
	@sorted = sort { $a->[2] <=> $b->[2] } @data;
	print map { '[' . join(', ', @$_) . "]\n" } @sorted;
	__END__
	[3, 3, 1, 3]
	[5, 5, 2, 5]
	[1, 1, 3, 1]
	[4, 4, 4, 4]
	[2, 2, 5, 2]

I hope it helps -- Julien


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

Date: 25 Aug 1999 12:51:29 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Sorting a list of lists
Message-Id: <7q0osh$4mk@dfw-ixnews3.ix.netcom.com>

DJ (djten@sisna.com) wrote:
: I've been using an SQL-Lite kind of module named Sprite for some simple
: database tasks.  It does not have ORDER BY functionality on the SELECT,
: which I have not needed ...  until now.  The SELECT returns a list of lists

You probably want to look into replacing Sprite with DBI and DBD::CSV; 
AFAIK they support ORDER BY and will work on your existing files.  
They're more actively maintained than Sprite, and allow you to migrate to 
a different database-storage scheme with very few changes to your code.
 


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

Date: Wed, 25 Aug 1999 09:49:27 +0100
From: Andrew Fry <andrewf@beausys.freeserve.co.uk>
Subject: Re: Win32::OLE to read Word file
Message-Id: <Vsa6OCAX46w3EwEY@beausys.freeserve.co.uk>

In article <935563406.13486.0.nnrp-09.9e983bf8@news.demon.co.uk>, Peter
Wilkinson <peterw@innate.co.uk> writes
>By the way what is 'ActivePerl'. I think I must have plain old,
inactive, perl.  It certainly
>does not have any menus!
>
>Peter Wilkinson

ActivePerl is a port of Perl for Win32 from ActiveState Tool
Corp.
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).


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

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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 636
*************************************


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