[10032] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3625 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 3 03:05:21 1998

Date: Thu, 3 Sep 98 00:00:42 -0700
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, 3 Sep 1998     Volume: 8 Number: 3625

Today's topics:
        [help]error code 139(when perl install..) <zpskcea@chollian.net>
    Re: ASCII codes of a string (Mark-Jason Dominus)
    Re: Encryption & File Locking <siberian@siberian.org>
    Re: Encryption & File Locking (Mark-Jason Dominus)
    Re: Hats off to Tom Phoenix (Jonathan Stowe)
        HELP ! Compile/Link error for PERL on Solaris <mmandava@cisco.com>
    Re: Help on a simple regex (Patrick Timmins)
    Re: How do I create a directory only if it doesn't exis (Tad McClellan)
    Re: How do I create a directory only if it doesn't exis <jhi@alpha.hut.fi>
        How to DownLoad a file w/o using the browser <vasant@bellatlantic.net>
    Re: how to generate random password <siberian@siberian.org>
    Re: In search of Intellegint Life... HELP!! (Alan Barclay)
        Net::SMTP Subject?? <siberian@siberian.org>
    Re: Perl & Java - differences and uses (Jon Bell)
    Re: Perl gurus opinion needed. (Alan Barclay)
    Re: Perl gurus opinion needed. (Mark-Jason Dominus)
    Re: Perl gurus opinion needed. (Shawn O'Donnell)
        Perl Licensing Requirements <wbanes@ibm.net>
    Re: Perl Licensing Requirements (Martien Verbruggen)
    Re: perl setup help <aqumsieh@tigre.matrox.com>
        Popup login box <felix@tarnconsulting.com>
        Sockets communication <mortensi@idt.ntnu.no>
    Re: Subtracting two arrays (Mark-Jason Dominus)
        Why seeking positions in Filehandle so slow?? jong@salt2.med.harvard.edu
        Why seeking positions in Filehandle so slow?? jong@salt2.med.harvard.edu
    Re: Why seeking positions in Filehandle so slow?? (Mark-Jason Dominus)
        Wrapper for Mysql.pm scripts under DBI? mschout@gkg.net
        Wrapper for Mysql.pm scripts under DBI? mschout@gkg.net
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 3 Sep 1998 13:46:45 +0900
From: "@L?5?A" <zpskcea@chollian.net>
Subject: [help]error code 139(when perl install..)
Message-Id: <6sl79a$dae$1@news.kornet.nm.kr>

I have a problem to install perl(version 5004_04) on hp-ux9.05 system.
When I install perl our system( I mean "make" command), I met with error
message like that.

"AutoSplitting Text::ParseWords (lib/auto/Text/ParseWords)"
sh: 15228 Memory fault - core dumped
*** Error code 139

I don't know how to handle it.
Please help me.!!

my email address : zpskcea@chollian.net







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

Date: 2 Sep 1998 23:50:45 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: ASCII codes of a string
Message-Id: <6sl3ml$j45$1@monet.op.net>

In article <35EDC7DD.E6C98E74@ab.bluecross.ca>,
Ky Nguyen  <knguyen@ab.bluecross.ca> wrote:
>How do I parse string "a,c" to print "61 2C 63"?

@codes = map { sprintf "%2X", ord $_ }
             (split //, $string);

print "@codes";




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

Date: Wed, 02 Sep 1998 20:25:22 -0700
From: John Armstrong <siberian@siberian.org>
Subject: Re: Encryption & File Locking
Message-Id: <35EE0D36.444069BE@siberian.org>

Specifically, if under UNIX, use PGP::Pipe. I dunno if it works anywhere
else. It requires a properly installed instance of PGP on your system as
well. I had to hack at it a bit toet it to work correctly in my case but it
does the job.

John Armstrong

Tom Phoenix wrote:

> On Tue, 1 Sep 1998, Vinay Gidwaney wrote:
>
> > I'm trying to encrypt a data file in perl... is there a way to do
> > that?
>
> Yes. Maybe you want one of the modules from CPAN?
>
> >     Also, when the perl script accesses the file, what are the
> > procedures to lock the file so that it can't be accessed by another
> > instance of my perl script?
>
> I think you could use the methods in Randal's fourth Web Techniques
> column, which explains how to use flock() to avoid problems when multiple
> processes need to modify one file. Hope this helps!
>
>    http://www.stonehenge.com/merlyn/WebTechniques/
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>



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

Date: 3 Sep 1998 00:17:37 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Encryption & File Locking
Message-Id: <6sl591$jbs$1@monet.op.net>


In article <6skqnr$o32$4@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>          "command < file" 
>
>doesn't scale trivially to more files.
>
>          "cat file | command"
>
>does.

I remember thinking exactly this same thing about a year ago.  I was
writing a Makefile, and I had

	target: $(SOURCE)
		./munge < $(SOURCE) >target

which was fine.  Then I thought a little further ahead, and changed it to 

	target: $(SOURCE)
		cat $(SOURCE) | ./munge > target

because I thought SOURCE might someday include multiple files.

Later I asked Randal what he thought about it, but I don't remember
the answer.



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

Date: Sat, 29 Aug 1998 21:56:18 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Hats off to Tom Phoenix
Message-Id: <35e873b9.41338532@news.btinternet.com>

On Sat, 29 Aug 1998 19:24:58 +0900, Norman UNsoliciteds wrote :

>I just read through six consecutive replies to newbie questions all from
>Tom Phoenix, I thoroughly admire him for his fairness while explaining
>politely where the info could be found (even if it was a FAQ) plus even
>giving some small hints as to the solution of the cause/solution of the
>prob he also managed to express the idea that perhaps the posters
>should've looked in the obvious places first without resorting to sarcasm,
>irony, down right bloody mindedness or worse.
>
Thats Tom P. for you.  Year on winner of the "nicest man on the
Newsgroup" award. But maybe the magnanimity is a form of satire: have
you thought of that?

>To be fair I have seen others do the same, but they ony seem to be able to
>hold out for a couple of posts before letting rip.
>

There is a scurrilous allegation making its rounds that the Usenet
manifestation of Tom Phoenix is merely a 'bot - infact some have even
gone to great lengths to prove this thesis - but of course he is a
good programmer and if he wrote himself who knows ?  Of course this is
all bollocks and you are absolutely right.

>A couple of karma points to ya!
>
Yeah and I reincarnate as a reptile but thats kharma for you.

/J\
-- 
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Wed, 02 Sep 1998 19:58:33 -0700
From: Mohan Mandava <mmandava@cisco.com>
Subject: HELP ! Compile/Link error for PERL on Solaris
Message-Id: <35EE05D9.FDC0B1AA@cisco.com>

I am  getting the following compile/link error when I install
perl5.00404 on Solaris 2.6. I have the gcc compiler (ver. 2.7.2.3) on my
Sun.

______________________________________________________________

# make perl
make: Warning: Both `makefile' and `Makefile' exist
/opt/GCC2723/bin/gcc   -o miniperl miniperlmain.o libperl.a 
Undefined			first referenced
 symbol  			    in file
log                                 libperl.a(pp.o)
pow                                 libperl.a(pp.o)
sqrt                                libperl.a(pp.o)
floor                               libperl.a(pp.o)
atan2                               libperl.a(pp.o)
exp                                 libperl.a(pp.o)
sin                                 libperl.a(pp.o)
cos                                 libperl.a(pp.o)
ld: fatal: Symbol referencing errors. No output written to miniperl
*** Error code 1
make: Fatal error: Command failed for target `miniperl'

_______________________________________________________

I don't understand why this is happening. It seems that the linker does
not see "math.h" but I don't know how to fix this problem.

Is this to be specified in the EXTLIB variable in the makefile ? How ?

Thanks,
-Mohan.


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

Date: Thu, 03 Sep 1998 03:56:05 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Help on a simple regex
Message-Id: <6sl40l$5h1$1@nnrp1.dejanews.com>

In article <35EDA8B4.60170683@infotechfl.com>,
  ozette.brown@infotechfl.com wrote:
> Andreas,
>
> Try something like this:
>
>    if (/(ab).*/)
>      {
>       $x = $1;
>       print "$x\n";
>      }
>
> This should match the first occurrence of "ab".  For more info, see the perl
> docs on regular expressions.
>
> Thanks,
>
> Ozette
[snip]

This is true, but I don't think it is what the original author wanted.
I think he wanted to know which inputs had one and only one "ab" in them.
Your example will match any input with one or *more* "ab"'s.

Also, why define the $1 in your example? Why not just:

    if (/(ab).*/)
      {
       print "$1\n";
      }

This is equivalent to your example.
Also, why use a back reference at all? Why not just:

    if (/ab.*/)
      {
       print "ab\n";
      }

This is also equivalent to your example.
Also, the .* in this case is superfluous. Why not just:

    if (/ab/)
      {
       print "ab\n";
      }

Again, this is also equivalent to your example. And again,
I don't think this is what the original poster asked for. Take a
look at Jonathan Feinberg's post in this thread for some good
examples of how to accomplish what the poster wanted.

Don't be discouraged! Look at my first posting in this thread
(the one *without* the apology). I was matching input that didn't
even have *one* occurance of "ab", so you've got me beat there!

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 2 Sep 1998 20:22:09 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do I create a directory only if it doesn't exists
Message-Id: <10rks6.pan.ln@metronet.com>

Jim Woodgate (jdw@dev.tivoli.com) wrote:

: "Rolf Rettinger" <rolf.rettinger@desy.de> writes:
: > is there any function like sysopen for a file to create a directory only if
: > it doesn't exists?

: you can use the -d test:

: mkdir $directory,0755 if ! -d $directory;


   Which will attempt to create the directory if there happens to
   be a non-directory type object (file, sym link...) there with
   the same name.


   Seems like    -e    would be better here...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 03 Sep 1998 09:47:28 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: How do I create a directory only if it doesn't exists
Message-Id: <oee90k1ae0v.fsf@alpha.hut.fi>


lr@hpl.hp.com (Larry Rosler) writes:
> The problem is knowing what's available in what module.  It's like 

Have you considered this newfangled, outlandish, sissyish,
nay, disgusting, idea called "reading the documentation"? :-)

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Thu, 03 Sep 1998 01:15:36 +0000
From: Vasant Kumar <vasant@bellatlantic.net>
Subject: How to DownLoad a file w/o using the browser
Message-Id: <35EDED90.4487@bellatlantic.net>

Hi -

Can someone refer me to some program, script, or code that will let me
download a file from the given URL site without using the browser. I do
have access to Unix and Windows 95 machine, and can use Perl, C, or
Java.

Example -

When I go to the following location using Netscape browser, I am
prompted if quotes.csv (the file name in this case) should be downloaded
or saved:

http://quote.yahoo.com/d/quotes.csv?s=dell&f=sl1d1t1c1ohgv&e=.csv

If I select 'save', the file quotes.csv is saved. IS THERE A SIMPLE WAY 
I can still download quotes.csv, in this example, without explicitly
going to the browser?

Any help is very much appreciated.

Thanks,

Vasant 

vasant@bellatlantic.net


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

Date: Wed, 02 Sep 1998 20:23:07 -0700
From: John Armstrong <siberian@siberian.org>
To: Dan Bassett <dan@bns.com>
Subject: Re: how to generate random password
Message-Id: <35EE0CA8.B2DECA82@siberian.org>

I use an external UNIX utility ( it may compile elsewhere, I never tried
) called 'pwgen' that I snagged off the web somewhere. It allows you to
specify length of the password to returns and returns random passwords
in mixed case like :
XqurtSz

I forget the URL I found it at , but I was digging on the web for it and
dug it up, you should be able to find it fairly painelssly. If you cant
find it lemme know and I will see if I can dig up my archival copy and
email it on over.

I imagine with a bit of creative xs'ing you could make it a perl module
which would be quite cool( unless such a beast already exists ).

John Armstrong

Dan Bassett wrote:

> I want to implement a script which generates random passwords.
> I understand their is a perl function called rand which could do this
> for me. However, I'm not sure what variables or expressions to use.
>
> Here is the format I was looking for:
>
> A random password which can contain a combination of uppercase
> letters, lowercase letters and numbers with a length of between
> 8 and 10 digits...
>
> Any help would be appreciated..
>
> Dan
> dan@bns.com
>



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

Date: 3 Sep 1998 02:48:27 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: In search of Intellegint Life... HELP!!
Message-Id: <904790898.669765@elaine.drink.com>

In article <ELdH1.108$kE2.957302@news.shore.net>,
Scratchie  <upsetter@ziplink.net> wrote:
>Mark Badolato <bady@primenet.com> wrote:
>
>: 1;
>
>Interesting that two people in a row posted the same thing. The semicolon
>is unnecessary. Only really a concern for those who obsess over very
>"wasted" keystroke, but I just thought I'd point it out in the interest of

Many of us are used to putting in 'unneccessary' ;'s so that when we
change the structure around they are there. 

if($condition){
	print "this";
	print "that"
}

compiles & runs ok. Add in _print "the other"_ just before the }, and it won't.
You need to add a ; after the "that". Changing two lines like this isn't
as natural as just adding in one.

Getting in the habit of adding the ';' at the end of every statement,
including those just before a } or at the end of the file where they're
not strictly necessary avoids having to re-edit files just to add them
when they become necessary.


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

Date: Wed, 02 Sep 1998 20:28:03 -0700
From: John Armstrong <siberian@siberian.org>
Subject: Net::SMTP Subject??
Message-Id: <35EE0DDE.5C2B3A6E@siberian.org>

Does anyone know how to set a subject header in Net::SMTP? I didnt see a
method for it and when I try to just append it to the datasend it just
heaps everything onto one line with '\n' seperating the to and subject
lines.

John Armstrong



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

Date: Thu, 3 Sep 1998 05:07:36 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Perl & Java - differences and uses
Message-Id: <EyozKo.Gzo@presby.edu>

In article <35ed93c2.0@news.netcom.co.uk>, Jim <-> wrote:
>I was originally only going to ask clpm but didn't want a biased opinion,
>thats also why I asked for references to info. We're all big boys, I'm sure
>we can discuss these things maturely, isn't that what usenet is all about?

Unfortunately, choice of programming language, for many people, is like
choice of religion.  And how many people can discuss religion in a mature
fashion?  :-)

-- 
Jon Bell <jtbell@presby.edu>


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

Date: 3 Sep 1998 02:51:44 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: Perl gurus opinion needed.
Message-Id: <904791091.119501@elaine.drink.com>

In article <35EDB96A.C276ED31@bbnplanet.com>,
Elaine -HappyFunBall- Ashton  <eashton@bbnplanet.com> wrote:
>perl jerky-boy
[You've read them already]
>perl dragon

>i could go on...this is fun. ideas anyone?

perl monger.


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

Date: 2 Sep 1998 23:40:53 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl gurus opinion needed.
Message-Id: <6sl345$j29$1@monet.op.net>

In article <35EDB96A.C276ED31@bbnplanet.com>,
Elaine -HappyFunBall- Ashton  <eashton@bbnplanet.com> wrote:
>perl jerky-boy
>perl tiger
>[etc.]

At the conference, when we were printing certificates, people asked us
for the darndest things.  We certified people as Perl Programmers,
Perl Studmuffins, Perl Gurus, Perl Hackers, Perl Engineers, Perl
Experts, Perl Wizards, Perl Poets, Perl Porters, Perl Pornographers,
and Perl Pimps.  

For some reason nobody asked to be a certified Perl Pederast.
I suppose it's only a matter of time.



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

Date: Thu, 03 Sep 1998 02:26:35 -0400
From: shawn@ultranet.com (Shawn O'Donnell)
Subject: Re: Perl gurus opinion needed.
Message-Id: <shawn-0309980226350001@d133.dial-1.cmb.ma.ultra.net>

In article <MPG.10574b6d7ba716cb989788@nntp.hpl.hp.com>, lr@hpl.hp.com
(Larry Rosler) wrote:

> Dmitry Dorofeev wrote:
> > it's sounds 'Perlacker'.
> 
> Dmitry's problem is that pronouncing it in Russian gives something like 
> "Perl Gacker".  Gack!  He is trying to drop the 'H' and it isn't as easy 
> as it is for the Cockneys.

Sometimes, 'H' -> 'Kh,' a raspy 'h' like the one you may know from
Hannukah.  Pizza Hut goes as "Pitstsa Khat," not "Pitstsa Gat" [pronounced
'pizza gut'], even though that's what you end up with.

How about Perl kheker?  or Perlmaster? or Perlozornik? (Perl mischief-maker)

I think there's an accepted Russian translation of "hacker," but it
emphasizes the breaking-and-entering sense of the term. 

Perlacker sounds like, "tot, u kogo ne khvataet perla." 

--Shawn

P.S.  All of this makes me wonder about Perl and Unicode...


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

Date: Wed, 02 Sep 1998 23:10:01 -0400
From: Wes Banes <wbanes@ibm.net>
Subject: Perl Licensing Requirements
Message-Id: <35EE0889.AB6F00B3@ibm.net>

Hi,

I was thinking about bundling perl or embedding perl is an application
that I would like to sell for $$$.  I was wondering if anybody knew what
the legal requirements for doing such might be.

Thanks



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

Date: Thu, 03 Sep 1998 03:04:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Licensing Requirements
Message-Id: <DGnH1.973$N02.2634@nsw.nnrp.telstra.net>

In article <35EE0889.AB6F00B3@ibm.net>,
	Wes Banes <wbanes@ibm.net> writes:
> Hi,
> 
> I was thinking about bundling perl or embedding perl is an application
> that I would like to sell for $$$.  I was wondering if anybody knew what
> the legal requirements for doing such might be.

Read the README file that comes with the perl distribution, which
should tell you to read the file Artistic. If you are talking about
some binary version, like the ActiveState version, consult their
website. Consult the documentation that most likely comes with the
distribution.

Any distributed version of perl _should_ come with a copyright notice.
Again: check the files README and Artistic.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 02 Sep 1998 16:34:22 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: perl setup help
Message-Id: <x3yiuj6w8xd.fsf@tigre.matrox.com>


Jeff & Rebecca Jo Isom <isom@aloha.net> writes:

> 
> I have just installed Red Hat Linux 5.1 and am trying to get perl up and
> running.  The box set came with perl and the installation put it in
> /usr/bin/perl.  I typed in the following script (copied from O'reilly
> Learning Perl book):
> 
> #!/usr/bin/perl -w
> print ("Hello, world!\n);
> 
> I get a permission denied message when I try to run the script.  I'm not
> sure if this is the right newsgroup for help with this, but I thought I
> would give it a shot.  I am new to Linux so please be detailed if the
> answer involves changing something there.  Thanks in advance for any
> help.
> 
> Jeff Isom
> 

You are just another victim of the Gates' virus. But you seem to have
found your cure ..

Anyway, you don't have the proper permissions to execute you little Perl
program. You can do either of two things (assuming your program is
called prog.pl):

1) chmod +x prog.pl

This makes your program executable, allowing you to run it. I also
suggest you read the man pages of chmod (type man chmod)

2) run your script as follows:

   perl prog.pl


Hope this helps,

-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: Wed, 2 Sep 1998 22:38:36 -0700
From: "Felix Tarnarider" <felix@tarnconsulting.com>
Subject: Popup login box
Message-Id: <6sl9p9$jbl@dfw-ixnews8.ix.netcom.com>

How do you get the login box to popup in IIS 4, using Perl?

Please email any answers as well as posting. Thanks

--felix




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

Date: 2 Sep 1998 14:18:01 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Sockets communication
Message-Id: <6sjk2p$5v$1@due.unit.no>

Hi

I realize that this question is oftenly asked, but I can't seem to
find the information that I need. What I want to do:

A server communicating with a client, both back and forth, as long as
the client wants to.

What I have done to achieve that:

Used the examples in the Camel-book on page 349-351. This makes it
possible to send a message Server -> Client, but not the other
way. Below follows some code from the Server and from the Client

------------client.pl------------
while (1) {
  if (my $line = <SOCK>) {print $line;}
  my $input = <STDIN>;
  chop $input;
  print SOCK $input;
} 
------------server.pl-------------
while (<STDIN>) {
  chomp;
  print "$_\n";
  last if ($_ eq "QUIT");
}
  
exit &$coderef();
------------------------------------

Thanks in advance.

Morten Simonsen

P.S. I get a warning because I use ($line = <SOCK>), if I ommit $line
= (not according to the book), no warning is issued. (Warning message
= "Value of <HANDLE> construct can be "0"; test with defined() at
client.pl line 22.")



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

Date: 2 Sep 1998 23:55:25 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Subtracting two arrays
Message-Id: <6sl3vd$j57$1@monet.op.net>

In article <MPG.10570b876e13b30798981f@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>@array3 = map $_ - shift @array1 => @array2;
>
>Simpler and more "Perl like", IMO.

I don't like the asymmetry here between @array1 and array2.  I like
similar things to be treated similarly.   I find this obfuscated.

Actually, I like the original code best, although I would replace
	<= $#array1

with
	< @array1

 .  If I were going to use `map', I would say

	@array3 = map {$array1[$_] - $array2[$_]} (0 .. $#array1);

I think it's clearer what is going on.



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

Date: Thu, 03 Sep 1998 03:10:28 GMT
From: jong@salt2.med.harvard.edu
Subject: Why seeking positions in Filehandle so slow??
Message-Id: <6sl1cv$28v$1@nnrp2.dejanews.com>

Hi,

I have a big file (over 100mb) and an index file for the
big file. The index file has the index of positions returned
from 'tell' for some words. eg)

SSSS=12341
YYYY=334324
TTTT=134243
 ...
 ..

When I tried to retrieve some strings in the big file
which is just below, say, SSSS, I use  'seek' to position
and read the file using while(<FILEHANLE>)

I find that it is very slow to retrieve 50 strings.

It seems that while seeks the position and when I tried to
read another position, it goes through from the start of
the file.

Is there any faster way to retrieve strings in big files by
using index file (or without it).

Thanks,

Jong


In reply, can you also send an email to me please?


--
jong@salt2.med.harvard.edu

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 03 Sep 1998 03:10:28 GMT
From: jong@salt2.med.harvard.edu
Subject: Why seeking positions in Filehandle so slow??
Message-Id: <6sl1b4$10v$1@nnrp1.dejanews.com>

Hi,

I have a big file (over 100mb) and an index file for the
big file. The index file has the index of positions returned
from 'tell' for some words. eg)

SSSS=12341
YYYY=334324
TTTT=134243
 ...
 ..

When I tried to retrieve some strings in the big file
which is just below, say, SSSS, I use  'seek' to position
and read the file using while(<FILEHANLE>)

I find that it is very slow to retrieve 50 strings.

It seems that while seeks the position and when I tried to
read another position, it goes through from the start of
the file.

Is there any faster way to retrieve strings in big files by
using index file (or without it).

Thanks,

Jong


In reply, can you also send an email to me please?


--
jong@salt2.med.harvard.edu

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 3 Sep 1998 00:12:16 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Why seeking positions in Filehandle so slow??
Message-Id: <6sl4v0$jaa$1@monet.op.net>

In article <6sl1cv$28v$1@nnrp2.dejanews.com>,
 <jong@salt2.med.harvard.edu> wrote:
>Hi,
>
>I have a big file (over 100mb) and an index file for the
>big file. The index file has the index of positions returned
>from 'tell' for some words. eg)
>I find that it is very slow to retrieve 50 strings.

Perhaps you are doing something strange, but without the code it is
hard to say.

I can tell you that I have often used this strategy and have found it
very effective, and not at all slow.

>In reply, can you also send an email to me please?

Maybe.


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

Date: Thu, 03 Sep 1998 03:17:56 GMT
From: mschout@gkg.net
Subject: Wrapper for Mysql.pm scripts under DBI?
Message-Id: <6sl1p4$16a$1@nnrp1.dejanews.com>

Hi.

Ive got several legacy Mysql scripts that I would like to convert to DBI
scripts.  Rather than modifying all of the scripts (changing all of the
$dbh->query() calls to $dbh->prepare(); $sth->execute();... $sth->finish()..
yuck!), I thought it would be nice to create some sort of wrapper module that
would allow Mysql.pm scripts to use the existing methods under DBI.

Has anone else considered doing this?  Does such a wrapper exist out there? 
If not, then I will consider writing one from scratch, but from my limited
attempts, inheritance of DBI seems not to work very well :(.

Regards,
Mike

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 03 Sep 1998 03:17:56 GMT
From: mschout@gkg.net
Subject: Wrapper for Mysql.pm scripts under DBI?
Message-Id: <6sl1qv$2b2$1@nnrp2.dejanews.com>

Hi.

Ive got several legacy Mysql scripts that I would like to convert to DBI
scripts.  Rather than modifying all of the scripts (changing all of the
$dbh->query() calls to $dbh->prepare(); $sth->execute();... $sth->finish()..
yuck!), I thought it would be nice to create some sort of wrapper module that
would allow Mysql.pm scripts to use the existing methods under DBI.

Has anone else considered doing this?  Does such a wrapper exist out there? 
If not, then I will consider writing one from scratch, but from my limited
attempts, inheritance of DBI seems not to work very well :(.

Regards,
Mike

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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