[18937] in Perl-Users-Digest
Perl-Users Digest, Issue: 1132 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 14 11:05:46 2001
Date: Thu, 14 Jun 2001 08:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <992531114-v10-i1132@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 14 Jun 2001 Volume: 10 Number: 1132
Today's topics:
Re: 2 questions about flock <m.grimshaw@salford.ac.uk>
accuracy on $i on for($i=0;$i<=1;$i++) <magnard@iap.fr>
An ever unwanted growing array??? <mark.stellaard@ict.nl_nospam>
Re: An ever unwanted growing array??? <pne-news-20010614@newton.digitalspace.net>
Re: An ever unwanted growing array??? <pne-news-20010614@newton.digitalspace.net>
Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution <julien.quint@imag.fr>
Re: Case insensitive substitution <peb@bms.umist.ac.uk>
Re: Case insensitive substitution (Jay Tilton)
Re: Case insensitive substitution <bart.lateur@skynet.be>
Re: Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution <bart.lateur@skynet.be>
Re: Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution (David McDuffee)
Re: Case insensitive substitution <bart.lateur@skynet.be>
Re: Case insensitive substitution <peb@bms.umist.ac.uk>
Re: Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution <no@email.at.all>
Re: Case insensitive substitution <bart.lateur@skynet.be>
Re: DBI problem (isterin)
Re: DBI problem (isterin)
Re: how to extract URL source with LWP ? (Helgi Briem)
Re: how to make a perl script run a batch file <Graham.T.Wood@oracle.com>
Re: how to make a perl script run a batch file (Helgi Briem)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 Jun 2001 15:18:56 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: 2 questions about flock
Message-Id: <3B28C7D0.FB922302@salford.ac.uk>
Anyone for the sync() question at the bottom?
Mark Grimshaw wrote:
>
> Mark Grimshaw wrote:
> >
> > Hi all,
> >
> > Looked through books, perldoc -f flock etc. but none the wiser.
> >
> > 1/
> > flock operates on a filehandle. How/can I implement it on a db_file
> > that has been opened with tie?
> >
> > 2/
> > Can someone explain, in plain English please, the difference between
> > LOCK_EX and LOCK_SH?
>
> To get this thread sort of back on track (as OP), I've been looking at
> Berkeley Databases and DB_File (which is what I'm using) as described on
> p392-3 of the camel book 2nd. edition. I notice it says be careful to
> use the sync() method so that data is actually written to the database
> _before_ it is unlocked and is not held in cache.
>
> I have the following snippet of code:
>
> ###############
> sub write_db # write data to db
> {
> my $string = $_[0];
> my $db = new my_DB;
> my ($len, $DB);
>
> # lock the lock file
> open(LOCK, ">$lock") or print "unable to open lock file: $!",
> $out->tail;
> flock(LOCK, LOCK_EX);
> if(!($DB = $db->open_db($db_file, O_RDWR|O_CREAT)))
> {
> print "Error. Failed to create/write database.";
> $out->tail;
> }
> # get length of DB which will provide db key for this record
> $len = keys %$DB;
> $DB->{$len} = $string;
> $db->sync(); # flush output to DB
> print "here<P>";
> untie %$DB;
> undef %$DB;
> close(LOCK); # unlocked as well.
> }
>
> ################
>
> open_db() is a db tie method I've defined in an external package:
>
> sub open_db # tie %DB to db with supplied mode
> {
> shift;
> my @input = @_;
> my %DB;
> tie(%DB, 'DB_File', $input[0], $input[1]) or return 0;
> return \%DB;
> }
>
> (as is tail()). That package has use DB_File; in it while the script
> above does not. Without the $db->sync(); statement above, the script
> works fine and prints my test statement "here" as well as outputting all
> the HTML print statements I have in other subroutines of the script -
> data is written to the database.
>
> With the $db->sync(); statement, "here" is not printed nor other print
> statements and data _is_ written to the database. I've tried adding a
> use DB_File; statment at the top of the script with the same results.
> I've tried the following:
> $db->sync() or die print "help: $!<P>"; # flush output to DB
> but no indication of an error occurs.
>
> Any idea what's up?
------------------------------
Date: Thu, 14 Jun 2001 16:43:45 +0200
From: Frederic Magnard <magnard@iap.fr>
Subject: accuracy on $i on for($i=0;$i<=1;$i++)
Message-Id: <Pine.OSF.4.33.0106141633080.10445-100000@hautbrion>
Hello,
As I type
$ perl -e 'for ($i=0.1; $i<=1; $i+=0.01) {print "$i\n";}'
I'm surprised to read the last lines on an DEC-osf machine:
0.690000000000001
...
0.??0000000000001
...
0.990000000000001
and these lines on a linux (pentium 3) machine:
0.889999999999999999
...
0.??9999999999999999
...
0.999999999999999999
What kind of error is that ? Or do I do something wrong ?
Thanks for any help,
Fred.
My perl version :
$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=dec_osf, osvers=4.0, archname=alpha-dec_osf-thread-multi
uname='osf1 trimoulet v4.0 1229 alpha '
config_args='-Dprefix=/home/seguret4/groupamax/usr/perl'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=define
Compiler:
cc='cc', ccflags ='-pthread -std -fprm d -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C',
optimize='-O4',
cppflags='-pthread -std -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
ccversion='V5.9-008', gccversion='', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=8, nvtype='long double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, usemymalloc=n, prototype=define
Linker and Libraries:
ld='ld', ldflags ='-L/home/seguret4/groupamax/usr/osf/lib -L/usr/local/lib'
libpth=/home/seguret4/groupamax/usr/osf/lib /usr/local/lib /usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib
libs=-lgdbm -ldbm -ldb -lm -liconv -lutil -lpthread -lexc
perllibs=-lm -liconv -lutil -lpthread -lexc
libc=/usr/shlib/libc.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -std -s -L/home/seguret4/groupamax/usr/osf/lib -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under dec_osf
Compiled at Apr 13 2001 19:16:57
%ENV:
PERLLIB="/tmp_mnt/home/seguret4/groupamax/soft/lheasoft/OSF1_4.0_alpha/scripts"
@INC:
/tmp_mnt/home/seguret4/groupamax/soft/lheasoft/OSF1_4.0_alpha/scripts
/home/seguret4/groupamax/usr/perl/lib/5.6.1/alpha-dec_osf-thread-multi
/home/seguret4/groupamax/usr/perl/lib/5.6.1
/home/seguret4/groupamax/usr/perl/lib/site_perl/5.6.1/alpha-dec_osf-thread-multi
/home/seguret4/groupamax/usr/perl/lib/site_perl/5.6.1
/home/seguret4/groupamax/usr/perl/lib/site_perl
.
--
Frédéric Magnard Jam Echelon system: AK-47 cocaine
http://www.iap.fr/users/magnard/ Stinger TWA 800 Militia Davidian
------------------------------
Date: Thu, 14 Jun 2001 15:19:08 +0200
From: "Mark Stellaard" <mark.stellaard@ict.nl_nospam>
Subject: An ever unwanted growing array???
Message-Id: <9gaddf$1c$1@tasmania.dev.ict.nl>
Anybody who can help me with this one????
I have two files: 'foo.pl' and a package 'bar.pm' see below
-> foo.pl <-
#!perl
use bar;
func_1; # 1st time call.
func_1; # 2nd time call.
-> bar.pm <-
package foo;
use strict;
my @files = ();
sub func_1 {
my @list = ();
@list = recursive($bar);
}
sub recursive($foo){
if ($bla) { &recursive($temp); }
else { push (@files, $foo); }
return @files; # files array contains all found files in directory
structure.
}
The problem is that every time I call 'func_1' the @list is growing and
growing.
I guess it has something to do with the global var @files.
But when using the 'my' for @files in the recursive function like this: push
( my @files, $foo),
it clears the @files every time when 'recursive' is called, because of the
'my'.
How can I use the function 'func_1' without letting the @list growing to
abnormal porportions???
So every time I call func_1 a new list must be used, which will be filled by
the 'recursive' function.
Thanx(again),
Mark
------------------------------
Date: Thu, 14 Jun 2001 16:32:09 +0200
From: Philip Newton <pne-news-20010614@newton.digitalspace.net>
Subject: Re: An ever unwanted growing array???
Message-Id: <vlihitc69mbsfk0oligmnpo9pe4e18idek@4ax.com>
On Thu, 14 Jun 2001 15:19:08 +0200, "Mark Stellaard"
<mark.stellaard@ict.nl_nospam> wrote:
> So every time I call func_1 a new list must be used, which will be filled by
> the 'recursive' function.
You could empty @files in func_1 with "@files = ()" before calling
recursive.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 14 Jun 2001 16:39:10 +0200
From: Philip Newton <pne-news-20010614@newton.digitalspace.net>
Subject: Re: An ever unwanted growing array???
Message-Id: <jrihit8jnmrmh9n6gl3b7j0v9bfn5ndaff@4ax.com>
On Thu, 14 Jun 2001 16:32:09 +0200, Philip Newton
<pne-news-20010614@newton.digitalspace.net> wrote:
> On Thu, 14 Jun 2001 15:19:08 +0200, "Mark Stellaard"
> <mark.stellaard@ict.nl_nospam> wrote:
>
> > So every time I call func_1 a new list must be used, which will be filled by
> > the 'recursive' function.
>
> You could empty @files in func_1 with "@files = ()" before calling
> recursive.
Another method is to use a wrapper function which you call from func_1.
This will also allow you to scope @files just to those two functions.
Something like this:
sub func_1 {
my @list = ();
@list = find_files($bar);
}
{
# scope for 'my @files' is only sub find_files and sub recursive
my @files;
sub find_files {
@files = ();
return recursive(@_);
}
sub recursive {
if ($bla) { recursive($temp); }
else { push (@files, $foo); }
return @files; # files array contains all found files in
# directory structure.
}
}
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 14 Jun 2001 11:12:03 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Case insensitive substitution
Message-Id: <V50W6.12319$9t5.624884@news6-win.server.ntlworld.com>
I've looked through the necessary resources for ideas on this, I found
something like it but it certainly doesn't do it as I wish.
Basically I have a search on my site, and I want the keyword(s) entered
to display in bold in the search results. All I need to do is
substitute the word, for the word with bold tags around it, like so -
$text =~ s\$keyword1\<b>$keyword1</b>\g;
Which works fine if the case matches exactly, is there a way of matching
insensitively?
Many thanks,
--
Brian
------------------------------
Date: 14 Jun 2001 12:29:23 +0200
From: Julien Quint <julien.quint@imag.fr>
Subject: Re: Case insensitive substitution
Message-Id: <khvlmmvwe0s.fsf@imag.fr>
"Brian Wakem" <no@email.at.all> writes:
> $text =~ s\$keyword1\<b>$keyword1</b>\g;
>
> Which works fine if the case matches exactly, is there a way of matching
> insensitively?
Yes, just use the i flag together with g (eg s/.../.../gi). You can read
perldoc perlre for the other options of the substitution. Don't forget to
set the locale (perldoc locale) if your text contains accents, etc.
--
Julien
------------------------------
Date: Thu, 14 Jun 2001 11:48:08 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Case insensitive substitution
Message-Id: <3B289668.E53246A1@bms.umist.ac.uk>
> I've looked through the necessary resources for ideas on this, I found
> something like it but it certainly doesn't do it as I wish.
did you read up on the substitution operator?
try typing 'perldoc perlop' on the command line to learn more.
> Basically I have a search on my site, and I want the keyword(s) entered
> to display in bold in the search results. All I need to do is
> substitute the word, for the word with bold tags around it, like so -
>
> $text =~ s\$keyword1\<b>$keyword1</b>\g;
>
> Which works fine if the case matches exactly, is there a way of matching
> insensitively?
just use s\$keyword1\<b>$keyword1</b>\ig;
The 'i' at the end makes the match case insensitive.
HTH
Paul
------------------------------
Date: Thu, 14 Jun 2001 10:48:38 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Case insensitive substitution
Message-Id: <3b28954c.4793975@news.erols.com>
On Thu, 14 Jun 2001 11:12:03 +0100, "Brian Wakem" <no@email.at.all> wrote:
>$text =~ s\$keyword1\<b>$keyword1</b>\g;
>
>Which works fine if the case matches exactly, is there a way of matching
>insensitively?
The /i modifier does it.
$text =~ s\$keyword1\<b>$keyword1</b>\ig;
But that could smash case between the match and the substitution. Capture
the match if you want to preserve its case.
$text =~ s\($keyword1)\<b>$1</b>\ig;
------------------------------
Date: Thu, 14 Jun 2001 11:03:50 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Case insensitive substitution
Message-Id: <ig6hit8tvg2e3d4ifh35s7de1n7hoea4u9@4ax.com>
Brian Wakem wrote:
>$text =~ s\$keyword1\<b>$keyword1</b>\g;
Backslashes? That's nuts. What if you need a backslash for anything?
>Which works fine if the case matches exactly, is there a way of matching
>insensitively?
$text =~ s:\b($keyword1)\b:<b>$1</b>:gi;
--
Bart.
------------------------------
Date: Thu, 14 Jun 2001 12:28:24 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Re: Case insensitive substitution
Message-Id: <wd1W6.2669$A45.219146@news2-win.server.ntlworld.com>
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:ig6hit8tvg2e3d4ifh35s7de1n7hoea4u9@4ax.com...
> Brian Wakem wrote:
>
> >$text =~ s\$keyword1\<b>$keyword1</b>\g;
>
> Backslashes? That's nuts. What if you need a backslash for anything?
<snip>
There is a forward slash in the closing bold tag, hence the backslashes.
I don't see how this could cause a problem in this case?
--
Brian
------------------------------
Date: Thu, 14 Jun 2001 12:29:01 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Re: Case insensitive substitution
Message-Id: <3e1W6.2676$A45.220166@news2-win.server.ntlworld.com>
"Julien Quint" <julien.quint@imag.fr> wrote in message
news:khvlmmvwe0s.fsf@imag.fr...
> "Brian Wakem" <no@email.at.all> writes:
>
> > $text =~ s\$keyword1\<b>$keyword1</b>\g;
> >
> > Which works fine if the case matches exactly, is there a way of
matching
> > insensitively?
>
> Yes, just use the i flag together with g (eg s/.../.../gi). You can
read
> perldoc perlre for the other options of the substitution. Don't forget
to
> set the locale (perldoc locale) if your text contains accents, etc.
Thank you, works a treat.
--
Brian
------------------------------
Date: Thu, 14 Jun 2001 12:29:46 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Re: Case insensitive substitution
Message-Id: <Me1W6.2686$A45.220554@news2-win.server.ntlworld.com>
"Jay Tilton" <tiltonj@erols.com> wrote in message
news:3b28954c.4793975@news.erols.com...
> On Thu, 14 Jun 2001 11:12:03 +0100, "Brian Wakem" <no@email.at.all>
wrote:
>
> >$text =~ s\$keyword1\<b>$keyword1</b>\g;
> >
> >Which works fine if the case matches exactly, is there a way of
matching
> >insensitively?
>
> The /i modifier does it.
>
> $text =~ s\$keyword1\<b>$keyword1</b>\ig;
>
> But that could smash case between the match and the substitution.
Capture
> the match if you want to preserve its case.
>
> $text =~ s\($keyword1)\<b>$1</b>\ig;
Preserving the case eh? I'll give that a try shortly, that should be
very helpful.
--
Brian
------------------------------
Date: Thu, 14 Jun 2001 12:28:53 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Case insensitive substitution
Message-Id: <3hbhitgr51ke5in4cqkjqds8ff3vn78tj3@4ax.com>
Brian Wakem wrote:
>> Backslashes? That's nuts. What if you need a backslash for anything?
><snip>
>
>There is a forward slash in the closing bold tag, hence the backslashes.
>I don't see how this could cause a problem in this case?
Well... I added the \b anchors, just so it would only match complete
words. In your case, that would not be possible. You cannot even escape
the backslashes so they would be included in the strings.
--
Bart.
------------------------------
Date: Thu, 14 Jun 2001 13:38:22 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Re: Case insensitive substitution
Message-Id: <5f2W6.3383$A45.248748@news2-win.server.ntlworld.com>
"Brian Wakem" <no@email.at.all> wrote in message
news:Me1W6.2686$A45.220554@news2-win.server.ntlworld.com...
>
> "Jay Tilton" <tiltonj@erols.com> wrote in message
> news:3b28954c.4793975@news.erols.com...
> > On Thu, 14 Jun 2001 11:12:03 +0100, "Brian Wakem" <no@email.at.all>
> wrote:
<snip>
> > But that could smash case between the match and the substitution.
> Capture
> > the match if you want to preserve its case.
> >
> > $text =~ s\($keyword1)\<b>$1</b>\ig;
>
>
> Preserving the case eh? I'll give that a try shortly, that should be
> very helpful.
>
Excellent, everything is now working as I was hoping.
--
Brian
------------------------------
Date: Thu, 14 Jun 2001 13:43:20 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Re: Case insensitive substitution
Message-Id: <Lj2W6.3423$A45.250724@news2-win.server.ntlworld.com>
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:3hbhitgr51ke5in4cqkjqds8ff3vn78tj3@4ax.com...
> Brian Wakem wrote:
>
> >> Backslashes? That's nuts. What if you need a backslash for
anything?
> ><snip>
> >
> >There is a forward slash in the closing bold tag, hence the
backslashes.
> >I don't see how this could cause a problem in this case?
>
> Well... I added the \b anchors, just so it would only match complete
> words. In your case, that would not be possible. You cannot even
escape
> the backslashes so they would be included in the strings.
I see. I do not want it to match exact words only (there is a 'match
exact phrase' box on the search page which runs through a different set
of code because by default it splits the phrase entered into separate
keywords, and searches for them all individually), so it should be ok
with \
--
Brian
------------------------------
Date: Thu, 14 Jun 2001 13:06:24 +0000 (UTC)
From: mcduffee@best.com (David McDuffee)
Subject: Re: Case insensitive substitution
Message-Id: <9gacsg$247k$1@nntp1.ba.best.com>
s/\b($keyword1)\b/<b>$1<\/b>/ig;
--
David McDuffee
mcduffee@best.com
------------------------------
Date: Thu, 14 Jun 2001 13:20:34 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Case insensitive substitution
Message-Id: <uiehits1p75pf3vspeob4msese2c2uhavp@4ax.com>
Brian Wakem wrote:
> I do not want it to match exact words only
So it's OK that, when searching for "one range", it will match part of
"the lone ranger"?
--
Bart.
------------------------------
Date: Thu, 14 Jun 2001 14:23:51 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Case insensitive substitution
Message-Id: <3B28BAE7.86080738@bms.umist.ac.uk>
Brian Wakem wrote:
>
> "Bart Lateur" <bart.lateur@skynet.be> wrote in message
> news:3hbhitgr51ke5in4cqkjqds8ff3vn78tj3@4ax.com...
> > Brian Wakem wrote:
> >
> > >> Backslashes? That's nuts. What if you need a backslash for
> anything?
> > ><snip>
> > >
> > >There is a forward slash in the closing bold tag, hence the
> backslashes.
> > >I don't see how this could cause a problem in this case?
> >
> > Well... I added the \b anchors, just so it would only match complete
> > words. In your case, that would not be possible. You cannot even
> escape
> > the backslashes so they would be included in the strings.
>
> I see. I do not want it to match exact words only (there is a 'match
> exact phrase' box on the search page which runs through a different set
> of code because by default it splits the phrase entered into separate
> keywords, and searches for them all individually), so it should be ok
> with \
But in your case if you search for the keyword 'man' you would also
match other words like 'woman'. This is why Bart suggested the use of
the \b anchor.
e.g.
perl -e '$_ = "man woman man-child maneater"; s/man/<b>man<\/b>/ig;
print'
outputs
<b>man</b> wo<b>man</b> <b>man</b>-child <b>man</b>eater
Is that what you wanted to happen?
Paul
------------------------------
Date: Thu, 14 Jun 2001 14:24:43 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Re: Case insensitive substitution
Message-Id: <yW2W6.3767$A45.266498@news2-win.server.ntlworld.com>
"Paul Boardman" <peb@bms.umist.ac.uk> wrote in message
news:3B28BAE7.86080738@bms.umist.ac.uk...
> Brian Wakem wrote:
> >
> > "Bart Lateur" <bart.lateur@skynet.be> wrote in message
> > news:3hbhitgr51ke5in4cqkjqds8ff3vn78tj3@4ax.com...
> > > Brian Wakem wrote:
> > >
> But in your case if you search for the keyword 'man' you would also
> match other words like 'woman'. This is why Bart suggested the use of
> the \b anchor.
>
> e.g.
>
> perl -e '$_ = "man woman man-child maneater"; s/man/<b>man<\/b>/ig;
> print'
>
> outputs
>
> <b>man</b> wo<b>man</b> <b>man</b>-child <b>man</b>eater
>
> Is that what you wanted to happen?
Yes. Like I said, the exact phrase box works differently. I wanted it
to search part words by default so that, for example, when entering "NT"
it would match "NT4" and make the NT bold, instead of just ignoring it
like in Bart's suggestion.
--
Brian
------------------------------
Date: Thu, 14 Jun 2001 14:25:25 +0100
From: "Brian Wakem" <no@email.at.all>
Subject: Re: Case insensitive substitution
Message-Id: <cX2W6.3772$A45.267013@news2-win.server.ntlworld.com>
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:uiehits1p75pf3vspeob4msese2c2uhavp@4ax.com...
> Brian Wakem wrote:
>
> > I do not want it to match exact words only
>
> So it's OK that, when searching for "one range", it will match part of
> "the lone ranger"?
>
Yes. Like I said, the exact phrase box works differently. I wanted it
to search part words by default so that, for example, when entering "NT"
it would match "NT4" and make the NT bold, instead of just ignoring it
like in your suggestion.
--
Brian
------------------------------
Date: Thu, 14 Jun 2001 14:24:12 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Case insensitive substitution
Message-Id: <83ihit4cne1fgft2e61timir2n8fgcaiq9@4ax.com>
Brian Wakem wrote:
>Yes. Like I said, the exact phrase box works differently. I wanted it
>to search part words by default so that, for example, when entering "NT"
>it would match "NT4" and make the NT bold, instead of just ignoring it
>like in your suggestion.
I would rather make NT4 bold instead of just NT.
You can offer your users a possibility for using wildcards. For example,
entering "NT*" can accept "NT4", but not "lint".
Converting a wildcard to a regex is basically replacing * with .* and ?
with . . You might want to limit what that dot matches, replacing it
with a character class. You can add \b or a construct with similar
effect (negative lookahead/lookbehind), depending on whether your phrase
starts or ends with a word character, or not.
--
Bart.
------------------------------
Date: 14 Jun 2001 07:18:03 -0700
From: isterin@hotmail.com (isterin)
Subject: Re: DBI problem
Message-Id: <db67a7f3.0106140618.70a06590@posting.google.com>
cgi@abv.bg (Vulcho Nedelchev) wrote in message news:<9ffb1079.0106132331.13bf8cec@posting.google.com>...
> On linux DBI is perfect but on windows is some problems.
What problems? I've been using for years with no platform specific
problems.
Drivers are
> not installing alwais correct and this is not very well.
I think it's because you need to follow the installation instructions.
However i try
> to use it for my windows work, it is not good.
Stop spreading this nonsense. It's production quality, just because
you didn't set it up correctly and/or using it correctly doesn't mean
that it's "not good", whatever that means.
Can i connect to DB
> without DBI, DB, DB_File and how can i do that ?
DBI/DBD is the prefered method of connecting, or you can write you own
wrapper in access :-), maybe it will be the new prefered way sort of
like DBI 2.
Ilya
------------------------------
Date: 14 Jun 2001 07:19:06 -0700
From: isterin@hotmail.com (isterin)
Subject: Re: DBI problem
Message-Id: <db67a7f3.0106140619.27591a4a@posting.google.com>
cgi@abv.bg (Vulcho Nedelchev) wrote in message news:<9ffb1079.0106132331.13bf8cec@posting.google.com>...
> On linux DBI is perfect but on windows is some problems. Drivers are
> not installing alwais correct and this is not very well. However i try
> to use it for my windows work, it is not good. Can i connect to DB
> without DBI, DB, DB_File and how can i do that ?
Wooopss didn't mean in access, typing too fast, I meant XS.
Ilya
------------------------------
Date: Thu, 14 Jun 2001 13:13:52 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: how to extract URL source with LWP ?
Message-Id: <3b28b751.1312119949@news.isholf.is>
On 13 Jun 2001 12:40:26 -0700, EPurcell@ix.netcom.com
(DrColombes) wrote:
>I want to extract source from a URL address.
>
>The sample Perl LWP code below (from p. 453 of the "Perl in a
>Nutshell" O'Reilly book), running on an ActiveState Perl installation,
>fails with a "Can't locate host" error message.
>
>----------------------------------------------------------------
>use LWP::UserAgent;
>$hdrs = new HTTP::Headers(Accept => 'text/plain',
> User-Agent => 'MegaBrowser/1.0');
This should be User_Agent, not User-Agent
>$url = new URI::URL('http:://www.latimes.com/');
>$req = new HTTP::Request(GET, $url, $hdrs);
>$ua = new LWP::UserAgent;
Add this line here:
$ua->proxy(['http'] => 'http://PROXY.DOMAIN.COM:PORT');
substituting your proxy server and port number.
>$resp = $ua->request($req);
>
>if ($resp->is_success) {
> print $resp->content;}
>else {
> print $resp->message;}
Lack of proxy is the reason for 98.3% of LWP failures.
83.7% of all statistics are made up.
Regards,
Helgi Briem
------------------------------
Date: Thu, 14 Jun 2001 14:15:57 +0100
From: Graham Wood <Graham.T.Wood@oracle.com>
Subject: Re: how to make a perl script run a batch file
Message-Id: <3B28B90D.73E7716A@oracle.com>
This is a multi-part message in MIME format.
--------------8CC3C9DB41C8ACE4D3977E59
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
emre wrote:
> Is it possible to write a perl script that runs an external batch file or
> any other application on a windows system?
Yes. Read about one or more of these:
system (perldoc -f system)
open (perldoc -f open)
exec (perldoc -f exec)
backticks (perldoc -q backticks)
There are doubtless more but these should get you started.
Graham Wood
--------------8CC3C9DB41C8ACE4D3977E59
Content-Type: text/x-vcard; charset=UTF-8;
name="Graham.T.Wood.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Graham Wood
Content-Disposition: attachment;
filename="Graham.T.Wood.vcf"
begin:vcard
n:;Graham
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Graham.T.Wood@oracle.com
fn:Graham Wood
end:vcard
--------------8CC3C9DB41C8ACE4D3977E59--
------------------------------
Date: Thu, 14 Jun 2001 13:28:47 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: how to make a perl script run a batch file
Message-Id: <3b28bb7a.1313184800@news.isholf.is>
On Thu, 14 Jun 2001 02:44:41 +0100, "emre"
<otoked@yahoo.com> wrote:
>Is it possible to write a perl script that runs an external batch file or
>any other application on a windows system?
Yep. Use
system($command); or $output = `$command`; or
$output = qx/$command/; or the Win32::Process module
which gives you more fine-tuned control over the application
and is preferred for GUI apps.
Regards,
Helgi Briem
------------------------------
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.
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 1132
***************************************