[24757] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6910 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 25 18:06:07 2004

Date: Wed, 25 Aug 2004 15:05:08 -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 2004     Volume: 10 Number: 6910

Today's topics:
        'R#' as a hash key? (entropy123)
    Re: 'R#' as a hash key? <tony_curtis32@yahoo.com>
    Re: 'R#' as a hash key? <postmaster@castleamber.com>
    Re: 'R#' as a hash key? <nobull@mail.com>
    Re: creating anonymous subroutines at runtime <cpyfykf02@sneakemail.com>
    Re: creating anonymous subroutines at runtime <mritty@gmail.com>
    Re: creating anonymous subroutines at runtime <cpyfykf02@sneakemail.com>
    Re: creating anonymous subroutines at runtime <nobull@mail.com>
    Re: creating anonymous subroutines at runtime <cpyfykf02@sneakemail.com>
    Re: creating anonymous subroutines at runtime <nobull@mail.com>
    Re: creating anonymous subroutines at runtime <cpyfykf02@sneakemail.com>
    Re: creating anonymous subroutines at runtime <nobull@mail.com>
    Re: creating anonymous subroutines at runtime <nobull@mail.com>
    Re: creating anonymous subroutines at runtime <cpyfykf02@sneakemail.com>
    Re: creating anonymous subroutines at runtime (Randal L. Schwartz)
        how to install sybperl??? <heyubo@hotmail.com>
    Re: how to install sybperl??? <nobull@mail.com>
        I Broke a scalar <no@no.invalid>
        Larry Wall & Cults (Xah Lee)
    Re: Oracle DBI/DBD and bind vars - so slooooowwwww <ltierney@ltierney.demon.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 25 Aug 2004 13:13:55 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: 'R#' as a hash key?
Message-Id: <90cdce37.0408251213.29f84550@posting.google.com>

Hey all,

Am pretty new to Perl and find myself writing a parser. One of the
items my parser is reading is 'R#'. R# would make a nice key, but R#
in my program automatically comments out the rest of the line. R\#
results in a compilation error, is there some way to allow my key to
be R#, or, alternatively, Change 'R#' to 'R' which is better for my
purposes...

Thanks,
ent


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

Date: Wed, 25 Aug 2004 15:17:01 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: 'R#' as a hash key?
Message-Id: <87zn4jrn0i.fsf@limey.hpcc.uh.edu>

>> On 25 Aug 2004 13:13:55 -0700,
>> email_entropy123@yahoo.com (entropy123) said:

> Hey all, Am pretty new to Perl and find myself writing a
> parser. One of the items my parser is reading is 'R#'. R#
> would make a nice key, but R# in my program automatically
> comments out the rest of the line. R\# results in a
> compilation error, is there some way to allow my key to be
> R#, or, alternatively, Change 'R#' to 'R' which is better

                                ^^^^ the answer
> for my purposes...

e.g.

$hash{'R#'} = 42;

use Data::Dumper;
print Dumper(\%hash);

    $VAR1 = {
              'R#' => 42
            };

hth
t


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

Date: 25 Aug 2004 20:22:45 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: 'R#' as a hash key?
Message-Id: <Xns95509C7191A98castleamber@130.133.1.4>

email_entropy123@yahoo.com (entropy123) wrote in 
news:90cdce37.0408251213.29f84550@posting.google.com:

> Hey all,
> 
> Am pretty new to Perl and find myself writing a parser. One of the
> items my parser is reading is 'R#'. R# would make a nice key, but R#
> in my program automatically comments out the rest of the line.

fix the program then.

> R\#
> results in a compilation error,

By Perl, your program, what?

> is there some way to allow my key to
> be R#, or, alternatively, Change 'R#' to 'R' which is better for my
> purposes...

No idea what you are talking about. R# just works as a hash key.


-- 
John                               MexIT: http://johnbokma.com/mexit/
                           personal page:       http://johnbokma.com/
        Experienced programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html


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

Date: Wed, 25 Aug 2004 21:25:58 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: 'R#' as a hash key?
Message-Id: <cgiscs$itc$1@sun3.bham.ac.uk>


> Am pretty new to Perl and find myself writing a parser. One of the
> items my parser is reading is 'R#'. R# would make a nice key, but R#
> in my program automatically comments out the rest of the line. R\#
> results in a compilation error, is there some way to allow my key to
> be R#, or, alternatively, Change 'R#' to 'R' which is better for my
> purposes...

Since we are obviously taking about the literal code of your program 
here the way to change R# to R depends on the text-editor you are using 
to edit your program but typically you'd place the cursor either before 
or after the # and hit delete forwards or delete backwards as appropriate.

Hash keys can be any string.

$foo{'R#'}

The bit in the {...} of a hash element reference is interpreted as an 
expression unless it is a 'word' i.e. something made up of letter, 
number and underscores.  If it is a word then it's interpreted as 
literal string.



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

Date: Wed, 25 Aug 2004 21:27:49 +0200
From: Arne =?ISO-8859-1?Q?G=F6deke?= <cpyfykf02@sneakemail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <20040825212749.33c933fe.cpyfykf02@sneakemail.com>

On Wed, 25 Aug 2004 17:29:33 GMT
"Paul Lalli" <mritty@gmail.com> wrote:

> "Arne G=F6deke" <cpyfykf02@sneakemail.com> wrote in message
> news:20040825190920.7a19d34b.cpyfykf02@sneakemail.com...
> On Wed, 25 Aug 2004 19:06:45 +0200 Arne G=F6deke <cpyfykf02@sneakemail.co=
m>
> wrote:
>=20
> >> hey everyone,
> >>
> >> is there a possibility to create anonymous subroutines at runtime with
> code-refs inside?
> >> I am aware of 'eval' but I cannot get it working like this (example to
> make clear what I want):
> >>
> >> $callback =3D sub { "some code" }
> >> $cb =3D eval "sub { &{$cb}(); }"; # This certainly fails.. since
> CODE(0xwhatever) is not a code-ref
> >>
> >> $cb should then be passed somewhere else. Basically, I just want to
> create nested anonymous subroutines..
> >>
> >> thanks in advance!
> >> arne g=F6deke
> >>
> > erm.. sorry, I made a mistake... that line should read:
> > $cb =3D eval "sub { &{$callback}(); }"; # This certainly fails.. since
> CODE(0xwhatever) is not a code-ref
>=20
> I don't really understand why you would want to do this, but the following
> worked for me when I modified your code:
>=20
> $callback =3D sub {
>     print "Hello World\n";
> };
> $cb =3D eval 'sub { &{$callback}; }';
> $cb->();
>=20
> The main problem is that your double quotes in the eval were interpolating
> $callback, whereas you wanted the eval to see the variable name. Changing=
 to
> single quotes eliminates this problem.
Ya, well.. I know all that. My problem is, that $callback in the new sub is=
 not a copy of $callback but rather=20
that same var. By using double-quotes I just tried to indicate that I need =
a copy. $callback changes afterwards.=20
Try that piece of code:

my $callback =3D sub {
    print "Hello World\n";
};

my $cb =3D eval { sub { &{$callback}(); } };
$callback =3D 0;
$cb->();

Is there any way to avoid that problem?

arne g=F6deke



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

Date: Wed, 25 Aug 2004 19:37:29 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <ZT5Xc.12803$oD2.6394@trndny08>


"Arne Gödeke" <cpyfykf02@sneakemail.com> wrote in message
news:20040825212749.33c933fe.cpyfykf02@sneakemail.com...
> On Wed, 25 Aug 2004 17:29:33 GMT "Paul Lalli" <mritty@gmail.com> wrote:

> > The main problem is that your double quotes in the eval were
interpolating
> > $callback, whereas you wanted the eval to see the variable name.
Changing to
> > single quotes eliminates this problem.
> Ya, well.. I know all that. My problem is, that $callback in the new sub
is not a copy of $callback but rather
> that same var. By using double-quotes I just tried to indicate that I need
a copy. $callback changes afterwards.
> Try that piece of code:
>
> my $callback = sub {
>     print "Hello World\n";
> };
>
> my $cb = eval { sub { &{$callback}(); } };
> $callback = 0;
> $cb->();
>
> Is there any way to avoid that problem?

Now I'm more confused.  Now it sounds like you just want $cb to call
whatever function was defined by $callback at the moment you define $cb.  So
why are you bothering with 'eval' at all?

my $callback = sub { print "Hello World\n"; };
my $cb = $callback;
$callback=0;
$cb->();

I think at this point it might be helpful if you explained *why* you're
doing all this.  What is the actual goal, for which you've decided the
correct solution is to use this "nested anonymous routine" method?

Paul Lalli




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

Date: Wed, 25 Aug 2004 21:51:26 +0200
From: Arne =?ISO-8859-1?Q?G=F6deke?= <cpyfykf02@sneakemail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <20040825215126.12442103.cpyfykf02@sneakemail.com>

> Now I'm more confused.  Now it sounds like you just want $cb to call
> whatever function was defined by $callback at the moment you define $cb. =
 So
> why are you bothering with 'eval' at all?
>=20
> my $callback =3D sub { print "Hello World\n"; };
> my $cb =3D $callback;
> $callback=3D0;
> $cb->();
>=20
> I think at this point it might be helpful if you explained *why* you're
> doing all this.  What is the actual goal, for which you've decided the
> correct solution is to use this "nested anonymous routine" method?
>=20
> Paul Lalli

Okay, you're right. This was a bit confusing.=20
Perhaps it would be too much to explain the whole thing. Basically the prob=
lem
is that I get a code-ref and need to wrap an anonymous sub around it which =
does some=20
things and then calls the original procedure. There would be some other way=
s to achieve
the same goal.. but now I am bothered by the fact that I can not get it wor=
king
this way. :)

arne g=F6deke




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

Date: Wed, 25 Aug 2004 21:09:59 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <cgires$ibp$1@sun3.bham.ac.uk>


Arne Gödeke wrote:

> I am bothered by the fact that I can not get it working
> this way. :)

In what way does your orginal code not work once you insert the missing 
backlash?



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

Date: Wed, 25 Aug 2004 22:21:24 +0200
From: Arne =?ISO-8859-1?Q?G=F6deke?= <cpyfykf02@sneakemail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <20040825222124.27c3374b.cpyfykf02@sneakemail.com>

> > I am bothered by the fact that I can not get it working
> > this way. :)
>=20
> In what way does your orginal code not work once you insert the missing=20
> backlash?

I posted an example of the problem. The $callback may change=20
afterwards and so does $callback in the new subroutine which=20
is expected behaviour. I want to avoid that. To indicate
that I used double-quotes.. I want $callback inside the new
anonymous sub to be a copy of the original $callback so it
does never change.

arne g=F6deke

try this:

my $callback =3D sub {
    print "Hello World\n";
};

my $cb =3D eval ' sub { &{$callback}(); } ';
$cb->();  # print "Hello World"
$callback =3D 0;
$cb->();  # does not


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

Date: Wed, 25 Aug 2004 21:36:03 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <cgisvo$j67$1@sun3.bham.ac.uk>



Arne Gödeke wrote:

> On Wed, 25 Aug 2004 17:29:33 GMT
> "Paul Lalli" <mritty@gmail.com> wrote:
> 
>>The main problem is that your double quotes in the eval were interpolating
>>$callback, whereas you wanted the eval to see the variable name. Changing to
>>single quotes eliminates this problem.
> 
> Ya, well.. I know all that. My problem is, that $callback in the new sub is not a copy of $callback but rather 
> that same var. By using double-quotes I just tried to indicate that I need a copy. $callback changes afterwards. 
> Try that piece of code:
> 
> my $callback = sub {
>     print "Hello World\n";
> };
> 
> my $cb = eval { sub { &{$callback}(); } };
> $callback = 0;
> $cb->();
> 
> Is there any way to avoid that problem?

OK, can you explain in what way the simple solution

   my $cb = $callback;

Suggested earlier in this thread falls short of your requirements?



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

Date: Wed, 25 Aug 2004 22:50:18 +0200
From: Arne =?ISO-8859-1?Q?G=F6deke?= <cpyfykf02@sneakemail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <20040825225018.6431f055.cpyfykf02@sneakemail.com>

> OK, can you explain in what way the simple solution
>=20
>    my $cb =3D $callback;
>=20
> Suggested earlier in this thread falls short of your requirements?

$cb is supposed to do more than just call $callback. So.. this
solution is not sufficient.

arne g=F6deke=20


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

Date: Wed, 25 Aug 2004 21:44:38 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <cgitfs$jas$1@sun3.bham.ac.uk>



Brian McCauley wrote:
> 
> 
> Arne Gödeke wrote:
>>
>> my $callback = sub {
>>     print "Hello World\n";
>> };
>>
>> my $cb = eval { sub { &{$callback}(); } };
>> $callback = 0;
>> $cb->();
>>
>> Is there any way to avoid that problem?
> 
> 
> OK, can you explain in what way the simple solution
> 
>   my $cb = $callback;
> 
> Suggested earlier in this thread falls short of your requirements?
> 

Don't bother to answer that, I was reading the thread out of order.

my $cb = do {
   my $copy_of_callback = $callback;
   sub {
     # Do stuff
     goto &$copy_of_callback;
}



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

Date: Wed, 25 Aug 2004 21:52:05 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <cgittq$jf6$1@sun3.bham.ac.uk>

Brian McCauley wrote in a truncated fashion:

> my $cb = do {
>   my $copy_of_callback = $callback;
>   sub {
>     # Do stuff
>     goto &$copy_of_callback;
> }
};

:-)



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

Date: Wed, 25 Aug 2004 22:57:25 +0200
From: Arne =?ISO-8859-1?Q?G=F6deke?= <cpyfykf02@sneakemail.com>
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <20040825225725.1f5048e7.cpyfykf02@sneakemail.com>

On Wed, 25 Aug 2004 21:52:05 +0100
Brian McCauley <nobull@mail.com> wrote:

> Brian McCauley wrote in a truncated fashion:
> 
> > my $cb = do {
> >   my $copy_of_callback = $callback;
> >   sub {
> >     # Do stuff
> >     goto &$copy_of_callback;
> > }
> };
> 
> :-)
> 

Ah thanks a lot. That's what I was looking for.

arne


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

Date: 25 Aug 2004 14:03:00 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: creating anonymous subroutines at runtime
Message-Id: <86brgzszgb.fsf@blue.stonehenge.com>

>>>>> "Arne" == Arne Gödeke <cpyfykf02@sneakemail.com> writes:

Arne> I posted an example of the problem. The $callback may change 
Arne> afterwards and so does $callback in the new subroutine which 
Arne> is expected behaviour. I want to avoid that. To indicate
Arne> that I used double-quotes.. I want $callback inside the new
Arne> anonymous sub to be a copy of the original $callback so it
Arne> does never change.

Then use a closure.

    my $callback = sub {
        print "Hello World\n";
    };
    ...
    my $cb = do { my $temp = $callback; eval 'sub { $temp->() }' };
    $callback = "goofy stuff"; # but this doesn't affect $cb now
    $cb->(); # says hello world!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 25 Aug 2004 16:42:40 -0400
From: "yubo he" <heyubo@hotmail.com>
Subject: how to install sybperl???
Message-Id: <1R6Xc.16495$_H5.538420@news20.bellglobal.com>

(windows) I download sybperl module, but can not compile(using bc 5.2), it
seems like makefile has some errors
error makefile 137:colon expected
fatal makefile 762: no terminator specified for in-line file operator

anybody has exp. ? thank you




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

Date: Wed, 25 Aug 2004 22:05:43 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: how to install sybperl???
Message-Id: <cgiunc$jte$1@sun3.bham.ac.uk>



yubo he wrote:

> (windows) I download sybperl module, but can not compile(using bc 5.2), it
> seems like makefile has some errors
> error makefile 137:colon expected
> fatal makefile 762: no terminator specified for in-line file operator
> 
> anybody has exp. ? thank you

The Makefile.PL shipped with Perl modules makes (on Win32) a Makefile 
that is suited to the Microsoft nmake not the Borland make.



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

Date: Wed, 25 Aug 2004 21:43:11 GMT
From: "no@no.invalid" <no@no.invalid>
Subject: I Broke a scalar
Message-Id: <PJ7Xc.9520$VY.4595@trndny09>

Can this be done?  Should right?  Well its not working =(
What's goin on?

my $a = '
$VAR1 = bless( {
                  'read_limit' => 3000,
                  'outbuffer' => '',
                  'write_limit' => 3000,
                  'index' => 0,
                  'inbuffer' => '',
                  'handle' => bless( \*Symbol::GEN1, 'IO::Socket::INET' ),
                  'writeonly' => undef,
                  'eof' => 0,
                  'choker' => undef,
                  'choked' => 0,
                  'error' => 0,
                  'linemode' => 0,
                  'sset' => bless( {
                                     'sessions' => {
 
'IO::Socket::INET=GLOB(0x1a4
c120)' => $VAR1
                                                   },
                                     'listen_socket' => bless( 
\*Symbol::GEN0, 'I
O::Socket::INET' ),
                                     'writers' => bless( [
                                                           undef,
                                                           0
                                                         ], 'IO::Select' ),
                                     'readers' => bless( [
                                                           '?',
                                                           2,
                                                           undef,
                                                           undef,
                                                           undef,
 
$VAR1->{'sset'}{'liste
n_socket'},
                                                           $VAR1->{'handle'}
                                                         ], 'IO::Select' )
                                   }, 'IO::LineBufferedSet' )
                }, 'IO::LineBufferedSessionData' );
$VAR1 = undef;
';
print $a;


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

Date: 25 Aug 2004 14:56:06 -0700
From: xah@xahlee.org (Xah Lee)
Subject: Larry Wall & Cults
Message-Id: <7fe97cc4.0408251356.34f2102a@posting.google.com>

Larry Wall and Cults
(Lazyness, Impatience and Hubris)
200012

Dear readers,

Did you know that throughout history there's this thing called cult?
It is a very interesting phenomenon. I don't have time to expound and
teach, but will try to brief you.

These cults, are often lead by a single person. They form a group as
small as a dozen to multinational octopuses (such as
Scientology). Their creed varies from the mild in appearance
(Dianetics) to appalling (flat earth, extraordinary life-after-death,
impinging apocalypse scenarios, militant anti-government conspiracy,
diabolism with human sacrifices ...). Don't think that i'm citing from
some arcane books buried in libraries. These are real, and not
difficult to find in real life. Some of these cult leaders, are so
able to totally wash their member's brain, as to have them
autonomously swear and volunteer to die for the cause of the cult.
Occasionally, you'll even see mass suicide.

You know, the world is not made completely of rubes. Somebody
somewhere, will observe this phenomenon and study or report it as
is. Big brother organizations, such as the FBI, is keen on these and
very interested in benefiting from social psychology themselves. They
are recorded in books too. Ever wonder why the library houses so many
cold volumes of paper? This is one contributing reason. You might be
interested to verify that sometimes.

These brain-washing phenomenon, are not limited to fanatical
life-and-death or otherwise dire beliefs. You see it work in all
manners of human thought in the general sense. From culture formation
to fashion to commercialism.  Surely you have heard of Adolf Hitler
and his atrocities of genocide? I must alert you, that a single person
couldn't commit such a crime. You see, even if you are superman, you
can only kill few at a time. You see, it is the people, people like
you and me, who commit the killings willingly, by Hitler's
teaching. You may say: "no, i won't ever do such stupid thing", well
because you are very ignorant about social psychology. It is precisely
innocent people like you and (not) me, who were lead by the radical
leaders of supreme brain-washing abilities. The innocent mob were
fervent in their leader's vision and beliefs to commit anything. You
know the concept of war, right? We have two massive body of people
committed to cut off other people's head or otherwise stick a knife in
their bodies or bomb off an arm or leg. How did that happen? Well, it
starts with patriotism for people like you and (not) me.

Now, back to topic. In the computing world, there're also bad seeds
with colorful creed taking innocent mobs forming cults. The three
principal virtues of a programmer are Laziness, Impatience, and
Hubris. Yes?

How can we prevent heinous cults then? Stop bending truths. Education
and rationalism. I'm starting my own cult to exterminate morons on
this earth.  Two things are on the top of my agenda: Unixism and Perl.

--------
This post is archived at
 http://xahlee.org/UnixResource_dir/writ/larry_wall_n_cults.html

Copyright 2000-2004 Xah Lee. Verbatim Reproduction for non-commercial
purposes is hereby granted provided proper credit is given.

 Xah
 xah@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html


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

Date: Wed, 25 Aug 2004 20:37:18 +0100
From: "lord0" <ltierney@ltierney.demon.co.uk>
Subject: Re: Oracle DBI/DBD and bind vars - so slooooowwwww
Message-Id: <cgippi$dsc$1$830fa7b3@news.demon.co.uk>

> >We're having a bit of a problem using bind vars with Oracle via
> >DBI/DBD::Oracle. Basically if we use bind vars the following code/query
> >takes about 35 seconds to return results if we don't use bind vars i.e.
hard
> >code the search parameters into the query then the results are returned
in
> >about 10seconds! Any ideas? We are using the following environment:
>
> Btw, which Oracle version?

>>> 9i enterprise
>
> I think you might wish to take this question to an Oracle-related group.

>>> Yeah probably right

> There are cases in Oracle where it makes better (much better) execution
> plans for queries where it has the parameters within the query as opposed
> to using bind parameters.

>>> I didn't realise this I thought bind vars were always better

> This behaviour is also highly dependent on
> Oracle server version and configuration (init.ora parameters). Also,
> whether or not the tables and indices related to the query are analyzed
> does affect the query performance. I suggest generating an execution
> plan at least for the case with hardcoded parameters (and preferably
> also for the bind-parameter case -- I'm just not certain how one would
> generate one).

>>> We have and at no point does the query not use indices. It first uses
the index on the auto_enter_date column (BTW we changed this bit to use
BETWEENS for the date - runs faster) and then uses an Intermedia/Full Text
index to search the complete entry via contains.
>
> As a final note, if the 'CONTAINS(complete_entry, ?) > 0' does what I
think
> (i.e. selects recors where the 'complete_entry' field contains the desired
> text), then be careful with this -- it'll always omit any indexes there
> might be for the 'complete_entry' field (because text indexes in Oracle
> index from start of the text, and if you match something from within the
> text, the indexes just cannot be used).
>
> Hmm.. now that I think of this; if you have a fixed set of words you'd
like
> to match (so, 'network' and some amount of others), and you don't expect
> many updates on this field, you might be able to make some experimentation
> by building function-based indices on
> CONTAINS(complete_entry, 'word')
> for each word you'd like to match -- and then using the corresponding
> fixed-parameter expressions in your query. The timestamps could still
> use the bind parameter.
>
> Leaving the actual SQL query for reference:
> >$sql="SELECT id, title, to_char(auto_enter_date, 'DD/MM/YYYY') as
> >auto_enter_date, tracker_ref, SUBSTR(description, 1, 255) AS description
> >FROM boss_contract_admin WHERE (1=1) AND auto_enter_date >= TO_DATE(?,
> >'DD/MM/YYYY') AND auto_enter_date <= TO_DATE(?, 'DD/MM/YYYY') AND
> >CONTAINS(complete_entry, ?) > 0";
> -- 
> Wolf  a.k.a.  Juha Laiho     Espoo, Finland
> (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
>          PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
> "...cancel my subscription to the resurrection!" (Jim Morrison)




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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

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

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6910
***************************************


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