[23403] in Perl-Users-Digest
Perl-Users Digest, Issue: 5621 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 6 06:06:05 2003
Date: Mon, 6 Oct 2003 03:05:09 -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 Mon, 6 Oct 2003 Volume: 10 Number: 5621
Today's topics:
Behaving like a shell <mb@uq.net.au>
Re: Behaving like a shell <krahnj@acm.org>
Re: Behaving like a shell <mb@uq.net.au>
Decimal separator changing between program runs (Lasse H?binette)
Re: fastest count of instances in string? (Roy Johnson)
Re: fastest count of instances in string? (Roy Johnson)
Re: fastest count of instances in string? <ict@eh.org>
Re: fastest count of instances in string? <krahnj@acm.org>
Re: How to generate this list? (Roy Johnson)
improve the efficiency <johnson@siukeung.com>
Re: improve the efficiency <nospam@bigpond.com>
Re: improve the efficiency <johnson@siukeung.com>
Re: improve the efficiency <nospam@bigpond.com>
Re: improve the efficiency <johnson@siukeung.com>
Looking for a search engine submit script <ir@microsoft.com>
Re: out of memory sbrk() <ndronen@io.frii.com>
parse boolean logic (Thomas Reat)
Re: parse boolean logic (Sam Holden)
Pattern Match With $ (2) (Cheok Yan Cheng)
Pattern Match With $ (Cheok Yan Cheng)
Re: pattern matching <invalid-email@rochester.rr.com>
regex with nots in it <usenet@bens-house.org.uk>
Strange behaviour with '\r' character [[ sorry my other (i5513)
Strange behaviour with '\r' character (i5513)
why do I see - Use of uninitialized value in undef oper <sunil_franklin@hotmail.com>
Re: why do I see - Use of uninitialized value in undef <kalinaubears@iinet.net.au>
Re: why do I see - Use of uninitialized value in undef <kaspREMOVE_CAPS@epatra.com>
Re: why do I see - Use of uninitialized value in undef <mpapec@yahoo.com>
Re: why do I see - Use of uninitialized value in undef <sunil_franklin@hotmail.com>
Writing your own Presentation Tool (Shlomi Fish)
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 06 Oct 2003 10:39:28 +1000
From: Matthew Braid <mb@uq.net.au>
Subject: Behaving like a shell
Message-Id: <blqdjv$j2j$1@bunyip.cc.uq.edu.au>
Hi all,
I've been looking around old messages trying to find if shell-like input
has been implemented already (ie input with up/down/left/right arrows
for navigation through history/the command line, tab complete commands
etc) but have had little luck so far.
I'm not writing a perl shell - I'm writing an application shell in perl
(_not_ a system shell - its an interactive command line interface to a
group of applications I'm writing).
I _can_ write it myself - Term::ReadKey works nicely on my system - but
if there's code out there already existing that I can modify to my needs
all the better :)
So does anyone know of a package/program already written that does what
I want?
MB
------------------------------
Date: Mon, 06 Oct 2003 03:49:46 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Behaving like a shell
Message-Id: <3F80E615.515E296E@acm.org>
Matthew Braid wrote:
>
> Hi all,
>
> I've been looking around old messages trying to find if shell-like input
> has been implemented already (ie input with up/down/left/right arrows
> for navigation through history/the command line, tab complete commands
> etc) but have had little luck so far.
>
> I'm not writing a perl shell - I'm writing an application shell in perl
> (_not_ a system shell - its an interactive command line interface to a
> group of applications I'm writing).
>
> I _can_ write it myself - Term::ReadKey works nicely on my system - but
> if there's code out there already existing that I can modify to my needs
> all the better :)
>
> So does anyone know of a package/program already written that does what
> I want?
Perhaps this is what you want:
http://www.gregorpurdy.com/gregor/psh/
John
--
use Perl;
program
fulfillment
------------------------------
Date: Mon, 06 Oct 2003 14:10:43 +1000
From: Matthew Braid <mb@uq.net.au>
Subject: Re: Behaving like a shell
Message-Id: <blqq02$gpj$1@bunyip.cc.uq.edu.au>
That seems to have all the behaviour I want :) Thanks.
MB
John W. Krahn wrote:
> Matthew Braid wrote:
>
>>Hi all,
>>
>>I've been looking around old messages trying to find if shell-like input
>>has been implemented already (ie input with up/down/left/right arrows
>>for navigation through history/the command line, tab complete commands
>>etc) but have had little luck so far.
>>
>>I'm not writing a perl shell - I'm writing an application shell in perl
>>(_not_ a system shell - its an interactive command line interface to a
>>group of applications I'm writing).
>>
>>I _can_ write it myself - Term::ReadKey works nicely on my system - but
>>if there's code out there already existing that I can modify to my needs
>>all the better :)
>>
>>So does anyone know of a package/program already written that does what
>>I want?
>
>
> Perhaps this is what you want:
>
> http://www.gregorpurdy.com/gregor/psh/
>
>
> John
------------------------------
Date: 5 Oct 2003 18:00:52 -0700
From: lh@nfs.se (Lasse H?binette)
Subject: Decimal separator changing between program runs
Message-Id: <bb6f52a9.0310051700.6602bbd6@posting.google.com>
Hi,
I have an interface written in Perl between two different systems. The
perl program is started with
case 1:
program.pl -n <integer> -m getPrice -t <string>
case 2:
program.pl -n <integer> -m enterDeal -t <string>
For case 1 the deciamal separator becomes "," and for case 2 it
becomes ".", and I don't know why. They are using different logic to
interface between the system but nothing that should mess up the
decimal separator. I have as part of the program written out all the
envrionment variables and they are exactly the same. So my question is
what decides the perl decimal separator in a program?
My LC settings are:
LC_MONETARY = sv
LC_CTYPE = sv
LC_MESSAGES = C
LC_NUMERIC = sv
Regards
Lasse
------------------------------
Date: 5 Oct 2003 18:46:26 -0700
From: rjohnson@shell.com (Roy Johnson)
Subject: Re: fastest count of instances in string?
Message-Id: <3ee08638.0310051746.1fc499f1@posting.google.com>
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3F805799.76DE0A3C@acm.org>...
> If the value in $stupid is already a string why would you need to quote
> the variable?
Exactly. And if tr/stupid// doesn't change any values, why would you
need to specify the values not to change?
------------------------------
Date: 5 Oct 2003 18:49:26 -0700
From: rjohnson@shell.com (Roy Johnson)
Subject: Re: fastest count of instances in string?
Message-Id: <3ee08638.0310051749.292bad0d@posting.google.com>
Uri Guttman <uri@stemsystems.com> wrote in message news:<x7brsvlctf.fsf@mail.sysarch.com>...
> then there is another
> bug. if $tr_chars has more than 1 char then s/// not delete the
> individual chars. he needs a char class for that.
That's not a bug, it's a spec. The question was about counting how
many times an individual character appeared in a string.
I think there was a goof in the mtr sub, though: I left "a" instead of
"$tr_chars".
------------------------------
Date: 6 Oct 2003 11:57:08 +1000
From: Iain Truskett <ict@eh.org>
Subject: Re: fastest count of instances in string?
Message-Id: <slrnbo1jej.240.ict@dellah.org>
* Roy Johnson <rjohnson@shell.com>:
> * Uri Guttman <uri@stemsystems.com> wrote in message
> > then there is another bug. if $tr_chars has more than 1 char then
> > s/// not delete the individual chars. he needs a char class for
> > that.
> That's not a bug, it's a spec. The question was about counting how
> many times an individual character appeared in a string.
So why is it called $tr_chars instead of the singular $tr_char? Or even
just $char?
cheers,
--
Iain.
------------------------------
Date: Mon, 06 Oct 2003 03:15:39 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: fastest count of instances in string?
Message-Id: <3F80DE17.E890C1CB@acm.org>
Roy Johnson wrote:
>
> "John W. Krahn" <krahnj@acm.org> wrote in message news:<3F805799.76DE0A3C@acm.org>...
> > If the value in $stupid is already a string why would you need to quote
> > the variable?
>
> Exactly. And if tr/stupid// doesn't change any values, why would you
> need to specify the values not to change?
Ahh, but it does change values. It just changes them to the same thing
that they were before.
John
--
use Perl;
program
fulfillment
------------------------------
Date: 5 Oct 2003 19:49:03 -0700
From: rjohnson@shell.com (Roy Johnson)
Subject: Re: How to generate this list?
Message-Id: <3ee08638.0310051849.56a0fc2d@posting.google.com>
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3F7DCAF2.7DF0A772@acm.org>...
> > >
> > > my @array = qw/ A A A A B B C D D D /;
> > >
> > > print "$_\n" for glob "{@{[ join ',', @array ]}}" x @array;
> >
> > Would you explain the magic?
>
> glob uses the comma separated list in braces as alternatives in the
> result.
The snag is that it puts out every string of the length of the array
that can be made with any of the letters. e.g., DDDDDDDDDD is the last
string out. You could filter the results by comparing the results to
the original array, though:
#untested
my $arstr = join('', sort @array);
for (glob "{@{[ join ',', @array ]}}" x @array) {
print "$_\n" if $arstr eq join('', sort (split '', $_));
}
------------------------------
Date: Mon, 6 Oct 2003 13:19:29 +0800
From: "Johnson Lau" <johnson@siukeung.com>
Subject: improve the efficiency
Message-Id: <blqu12$heq$1@justice.itsc.cuhk.edu.hk>
I wrote a code to compare the NAME1 in table1 an NAME2 in table2. If a NAME2 equals to any one of NAME1, delete the record
containing NAME2. Each of table1 and table2 is in Foxpro (*.dbf) format, containing around 6000 records and sorting according to
NAME1 or NAME2. It takes me around 2 hours to finish the job. Is it possible to improve the efficiency? Thanks very much.
#!/usr/bin/perl
use strict;
use DBI;
my $dbh = DBI->connect("DBI:XBase:") or die $DBI::errstr;
my $abc = $dbh->selectcol_arrayref("select NAME1 from table1");
my $def = $dbh->prepare("delete from table2 where NAME2 = ?", {'MaxRows' => 1});
foreach (@$abc) {
$lc->execute($_);
}
------------------------------
Date: Mon, 06 Oct 2003 15:38:45 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: improve the efficiency
Message-Id: <2311981.hecxWES94K@gregs-web-hosting-and-pickle-farming>
It was a dark and stormy night, and Johnson Lau managed to scribble:
> I wrote a code to compare the NAME1 in table1 an NAME2 in table2. If a
> NAME2 equals to any one of NAME1, delete the record containing NAME2. Each
> of table1 and table2 is in Foxpro (*.dbf) format, containing around 6000
> records and sorting according to NAME1 or NAME2. It takes me around 2
> hours to finish the job. Is it possible to improve the efficiency? Thanks
> very much.
>
>
> #!/usr/bin/perl
> use strict;
> use DBI;
> my $dbh = DBI->connect("DBI:XBase:") or die $DBI::errstr;
> my $abc = $dbh->selectcol_arrayref("select NAME1 from table1");
> my $def = $dbh->prepare("delete from table2 where NAME2 = ?", {'MaxRows'
> => 1}); foreach (@$abc) {
> $lc->execute($_);
> }
Knowing nothing about foxpro, I suggest
delete from table2 where NAME2 in (select NAME1 from table1)
Make sure Name2 is indexed.
gtoomey
------------------------------
Date: Mon, 6 Oct 2003 13:54:31 +0800
From: "Johnson Lau" <johnson@siukeung.com>
Subject: Re: improve the efficiency
Message-Id: <blr02u$irf$1@justice.itsc.cuhk.edu.hk>
"Gregory Toomey" <nospam@bigpond.com> 在郵件 news:2311981.hecxWES94K@gregs-web-hosting-and-pickle-farming 中撰寫...
> It was a dark and stormy night, and Johnson Lau managed to scribble:
>
> > I wrote a code to compare the NAME1 in table1 an NAME2 in table2. If a
> > NAME2 equals to any one of NAME1, delete the record containing NAME2. Each
> > of table1 and table2 is in Foxpro (*.dbf) format, containing around 6000
> > records and sorting according to NAME1 or NAME2. It takes me around 2
> > hours to finish the job. Is it possible to improve the efficiency? Thanks
> > very much.
> >
> >
> > #!/usr/bin/perl
> > use strict;
> > use DBI;
> > my $dbh = DBI->connect("DBI:XBase:") or die $DBI::errstr;
> > my $abc = $dbh->selectcol_arrayref("select NAME1 from table1");
> > my $def = $dbh->prepare("delete from table2 where NAME2 = ?", {'MaxRows'
> > => 1}); foreach (@$abc) {
> > $lc->execute($_);
> > }
>
> Knowing nothing about foxpro, I suggest
> delete from table2 where NAME2 in (select NAME1 from table1)
>
i got such error
DBD::XBase::db prepare failed: Relation expected near ` IN (select NAME1 from table1)'
> Make sure Name2 is indexed.
>
> gtoomey
------------------------------
Date: Mon, 06 Oct 2003 18:00:38 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: improve the efficiency
Message-Id: <1224330.2GIZYlYOqS@gregs-web-hosting-and-pickle-farming>
It was a dark and stormy night, and Johnson Lau managed to scribble:
>
> "Gregory Toomey" <nospam@bigpond.com> 在郵件
> news:2311981.hecxWES94K@gregs-web-hosting-and-pickle-farming 中撰寫...
>> It was a dark and stormy night, and Johnson Lau managed to scribble:
>>
>> > I wrote a code to compare the NAME1 in table1 an NAME2 in table2. If a
>> > NAME2 equals to any one of NAME1, delete the record containing NAME2.
>> > Each of table1 and table2 is in Foxpro (*.dbf) format, containing
>> > around 6000 records and sorting according to NAME1 or NAME2. It takes
>> > me around 2 hours to finish the job. Is it possible to improve the
>> > efficiency? Thanks very much.
>> >
>> >
>> > #!/usr/bin/perl
>> > use strict;
>> > use DBI;
>> > my $dbh = DBI->connect("DBI:XBase:") or die $DBI::errstr;
>> > my $abc = $dbh->selectcol_arrayref("select NAME1 from table1");
>> > my $def = $dbh->prepare("delete from table2 where NAME2 = ?",
>> > {'MaxRows' => 1}); foreach (@$abc) {
>> > $lc->execute($_);
>> > }
>>
>> Knowing nothing about foxpro, I suggest
>> delete from table2 where NAME2 in (select NAME1 from table1)
>>
>
> i got such error
>
> DBD::XBase::db prepare failed: Relation expected near ` IN (select NAME1
> from table1)'
>
>
>> Make sure Name2 is indexed.
>>
>> gtoomey
Then your SQL probably hoes not have sub-selects. Just make sure Name2 is indexed ie has a secondary/non-unique index.
A database like Oracle or even mysql would be ables to do this in a few seconds so I dont know why it takes you hours.
gtoomey
------------------------------
Date: Mon, 6 Oct 2003 16:34:51 +0800
From: "Johnson Lau" <johnson@siukeung.com>
Subject: Re: improve the efficiency
Message-Id: <blr9fb$og4$1@justice.itsc.cuhk.edu.hk>
"Gregory Toomey" <nospam@bigpond.com> 在郵件 news:1224330.2GIZYlYOqS@gregs-web-hosting-and-pickle-farming 中撰寫...
> It was a dark and stormy night, and Johnson Lau managed to scribble:
>
> >
> > "Gregory Toomey" <nospam@bigpond.com> 在郵件
> > news:2311981.hecxWES94K@gregs-web-hosting-and-pickle-farming 中撰寫...
> >> It was a dark and stormy night, and Johnson Lau managed to scribble:
> >>
> >> > I wrote a code to compare the NAME1 in table1 an NAME2 in table2. If a
> >> > NAME2 equals to any one of NAME1, delete the record containing NAME2.
> >> > Each of table1 and table2 is in Foxpro (*.dbf) format, containing
> >> > around 6000 records and sorting according to NAME1 or NAME2. It takes
> >> > me around 2 hours to finish the job. Is it possible to improve the
> >> > efficiency? Thanks very much.
> >> >
> >> >
> >> > #!/usr/bin/perl
> >> > use strict;
> >> > use DBI;
> >> > my $dbh = DBI->connect("DBI:XBase:") or die $DBI::errstr;
> >> > my $abc = $dbh->selectcol_arrayref("select NAME1 from table1");
> >> > my $def = $dbh->prepare("delete from table2 where NAME2 = ?",
> >> > {'MaxRows' => 1}); foreach (@$abc) {
> >> > $lc->execute($_);
> >> > }
> >>
> >> Knowing nothing about foxpro, I suggest
> >> delete from table2 where NAME2 in (select NAME1 from table1)
> >>
> >
> > i got such error
> >
> > DBD::XBase::db prepare failed: Relation expected near ` IN (select NAME1
> > from table1)'
> >
> >
> >> Make sure Name2 is indexed.
> >>
> >> gtoomey
>
> Then your SQL probably hoes not have sub-selects. Just make sure Name2 is indexed ie has a secondary/non-unique index.
>
> A database like Oracle or even mysql would be ables to do this in a few seconds so I dont know why it takes you hours.
then i will try to convert the database to mysql, thanks very much
>
> gtoomey
------------------------------
Date: Mon, 06 Oct 2003 07:16:23 GMT
From: "Public Interest" <ir@microsoft.com>
Subject: Looking for a search engine submit script
Message-Id: <bF8gb.166115$0v4.12560844@bgtnsc04-news.ops.worldnet.att.net>
The most recent ones I can find online is as out of date as 2001. What I am
looking for is something like http://www.addpro.com/submit30.htm
But even this most recent "free tool" has 3-4 out of date links.
I remember on http://www.jimworld.com/tools/ there was a free tool, but he
took it out of his website and he never released the source code.
Basically, anyone who kept track of url submiting syntax on different search
engines can write a Perl or HTML tools easily...
------------------------------
Date: 06 Oct 2003 03:33:05 GMT
From: Nicholas Dronen <ndronen@io.frii.com>
Subject: Re: out of memory sbrk()
Message-Id: <3f80e271$0$194$75868355@news.frii.net>
fred <gsforgam@yahoo.fr> wrote:
f> hello ,
f> my perl program is going out of memory during its exceution ( sbrk() is
f> ... )
f> i m new to this langage and i would like advice to know how i can
f> instrument this code and see where i can reduce the amount of object i
f> create.
f> something like purify quantity for perl .
Perhaps your resource limits are just too low.
Regards,
Nicholas
--
"Why shouldn't I top-post?" http://www.aglami.com/tpfaq.html
"Meanings are another story." http://www.ifas.org/wa/glossolalia.html
------------------------------
Date: 5 Oct 2003 21:01:04 -0700
From: treat00@yahoo.com (Thomas Reat)
Subject: parse boolean logic
Message-Id: <3c4289ad.0310052001.2c466592@posting.google.com>
I have a perl script that must take some boolean logic as input.
Something like:
((a || b) & !c) || d || (e && f)
Is there any module out there that can help me parse this? And
evaluate it as well?
Ideally I would pass it the expression and a hash (or callback) to get
the values of each variable. And it returns the value of the whole
expression. But if there's nothing that does that, I'm interested in
anything that helps with this.
------------------------------
Date: 6 Oct 2003 04:38:42 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: parse boolean logic
Message-Id: <slrnbo1sei.isg.sholden@flexal.cs.usyd.edu.au>
On 5 Oct 2003 21:01:04 -0700, Thomas Reat <treat00@yahoo.com> wrote:
> I have a perl script that must take some boolean logic as input.
> Something like:
>
> ((a || b) & !c) || d || (e && f)
>
> Is there any module out there that can help me parse this? And
> evaluate it as well?
Parse::RecDescent on cpan makes such a thing really easy.
One of the examples in the docs is essentially the grammar
you have above (though I don't think the example does evaluation
of the parse tree - but that's easy too).
--
Sam Holden
------------------------------
Date: 6 Oct 2003 03:03:59 -0700
From: yccheok@yahoo.com (Cheok Yan Cheng)
Subject: Pattern Match With $ (2)
Message-Id: <4d2111c5.0310060203.3da86a45@posting.google.com>
soly for the previous msg. here, i narrow down my problem to
--------------------------------------------------------------------------------
#!/usr/intel/bin/perl
$ebb = '$ebb';
if($ebb =~ /${ebb}/)
{
print $ebb." match\n";
}
else
{
print $ebb." not match\n"
}
$banana = 'banana';
if($banana =~ /${banana}/)
{
print $banana." match\n";
}
else
{
print $banana." not match\n";
}
-------------------------------------------------------------------------------
i expect both are match. but i got the result:
-------------------------------------------------------------------------------
$ebb not match
banana match
-------------------------------------------------------------------------------
how can i solve this problem?
thank you.
regards
yccheok
------------------------------
Date: 6 Oct 2003 02:38:06 -0700
From: yccheok@yahoo.com (Cheok Yan Cheng)
Subject: Pattern Match With $
Message-Id: <4d2111c5.0310060138.42c58eb4@posting.google.com>
i have a file named 'list' with content:
--------------------------------------------------------------------------------
$ebb.runrv_out
$ebb.emsh_log
rv/$ebb.rv.audit
$ebb.notexist
--------------------------------------------------------------------------------
i try the following code:
#!/usr/intel/bin/perl
$ebb = '$ebb';
open(LIST, "list") || die "$!\n";
while(<LIST>)
{
print;
print " is going match with $ebb\n";
if(/^${ebb}(\.)/)
{
print "YEAH!\n";
}
else
{
print "NO!\n";
}
}
close(LIST);
the output i get is
--------------------------------------------------------------------------------
$ebb.runrv_out
is going match with
NO!
$ebb.emsh_log
is going match with
NO!
rv/$ebb.rv.audit
is going match with
NO!
$ebb.notexist
is going match with
NO!
--------------------------------------------------------------------------------
i expect to get "YEAH" frm pattern
if(/^${ebb}(\.)/)
but it failed :( may i noe how can i solve this prob?
thank you.
regards
yccheok
------------------------------
Date: Mon, 06 Oct 2003 01:10:15 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: pattern matching
Message-Id: <3F80C08B.2070501@rochester.rr.com>
Lex wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnbo0iqi.dra.tadmc@magna.augustmail.com...
>
>
use strict;
use warnings;
>> my %xref;
>> while ( <DB> ) {
>> my($id, $word, $plural, $synonym) = split /\|/;
>> @xref{ $word, $plural, $synonym } = ($id, $id, $id);
>> }
>>
>
> This bit seems to work.
>
>
>> foreach my $word ( $meaning =~ /(\S+)/g ) {
>> print "make a link to ID $xref{$word}\n" if exists $xref{$word}
>> }
>>
>>
>
> Here nothing seems to happen. I included $test .= $word; and tried to print
> it but 0 results...
>
> What am I doing wrong?
I would suggest using the Perl debugger to find out:
perl -d scriptname.pl
See:
perldoc perldebug
...
> Lex
Try something like this (note: additional words that are actually in
your sample "dictionary" were added to two of the "meanings" so non-null
results are obtained):
use strict;
use warnings;
my %xref;
my %meaning;
while ( <DATA> ) {
chomp;
my($id, $word, $plural, $synonym,$cat,$meaning) = split /\|/;
@xref{($word, $plural, $synonym)} = ($id)x3;
$meaning{$id}=$meaning;
}
foreach my $id(keys %meaning){
foreach my $word ( $meaning{$id} =~ /(\S+)/g ) {
print "make a link from ID $id to ID $xref{$word}\n"
if exists $xref{$word}
}
}
__END__
1|aardscheerder|aardscheerders|||aberratie Populaire, uit het Engels
(Earth grazer) afkomstige benaming voor een planeto骾e (of komeet) die
de aarde zeer dicht kan naderen.||||||||||
2|aberratie||||Kleine, schijnbare verplaatsing van een hemellichaam in
de richting waarin de waarnemer beweegt.||||||||||
3|absolute helderheid||||Helderheid die een hemellichaam zou hebben
wanneer het zich op een afstand van 10 parsec zou bevinden.||||||||||
4|absorptielijn|absorptielijnen|||abundantie Smalle donkere lijn in een
absorptiespectrum, veroorzaakt doordat een specifieke golflengte van het
licht wordt geabsorbeerd door materie die zich tussen de lichtbron en de
waarnemer bevindt.||||||||||
5|abundantie|abondantie|||De relatieve hoeveelheden van de verschillende
scheikundige elementen die in sterren of gasnevels voorkomen.||||||||||
Then you'll have to figure out how to "make a link".
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Mon, 06 Oct 2003 09:58:14 +0100
From: "Ben Holness" <usenet@bens-house.org.uk>
Subject: regex with nots in it
Message-Id: <pan.2003.10.06.08.58.11.731075@bens-house.org.uk>
Hi all,
I would like to know if it is possible to have nots in a single regular
expression and if so, how to do it?
For example if I want a single regular expression that says:
The phrase must have the string "Perl" and must not be followed by "PHP" in it, so that it
would match:
"I like Perl"
"Perl is cool"
But not match
"I like Perl more than PHP"
"Although PHP is OK"
I haven't been able to work out how to do it, but if '!' were the not
operator, then I guess it would be something like
/Perl.*![PHP]/
Searching hasn't been much help - the word "not" is way too common :)
Cheers,
Ben
------------------------------
Date: 6 Oct 2003 02:04:45 -0700
From: i5513@hotmail.com (i5513)
Subject: Strange behaviour with '\r' character [[ sorry my other post was wrong typed ]]
Message-Id: <a657ec02.0310060104.6c7d7a26@posting.google.com>
Hi!. I don't understand ...
At a html page:
<form name="form1" method="POST" action="example.cgi" >
<textarea name="text"></textarea>
</form>
At a cgi script (example.cgi)
(After get parameters)
if ($FORM{"text"} =~ /^(\s|\n|\r)*$/)
{
print "<HTML>";
if ($FORM{"text"} =~ /\r/)
{
print "Hey! It is here! <BR> ";
}
if ($FORM{"text"} =~ /^(\s|\n)*$/)
{
print "Now it isn't here!";
}
print "</HTML>";
exit (1);
}
Well, When I execute (on Windows) this script with one simple return
on textarea. It gives me next result:
Hey! It is here!
Now it isn't here!
What does Perl do with '\r' character?
Thanks you!
------------------------------
Date: 6 Oct 2003 02:02:18 -0700
From: i5513@hotmail.com (i5513)
Subject: Strange behaviour with '\r' character
Message-Id: <a657ec02.0310060102.5adb6439@posting.google.com>
Hi!. I don't understand ...
At a html page:
<form name="form1" method="POST" action="example.cgi" >
<textarea name="text"></textarea>
</form>
At a cgi script (example.cgi)
(After get parameters)
if ($FORM{"text"} =~ /^(\s|\n|\r)*$/)
{
print "<HTML>";
if ($FORM{"text"} =~ /\r/)
{
print "Hey! It is here! <BR> ";
}
if ($FORM{"texto_in"} =~ /^(\s|\n)*$/)
{
print "Now it isn't here!";
}
print "</HTML>";
exit (1);
}
Well, When I execute (on Windows) this script with one simple return
on textarea. It gives me next result:
Hey! It is here!
Now it isn't here!
What does Perl do with '\r' character?
Thanks you!
------------------------------
Date: Mon, 6 Oct 2003 11:41:14 +0530
From: "Sunil" <sunil_franklin@hotmail.com>
Subject: why do I see - Use of uninitialized value in undef operator ...
Message-Id: <AQ7gb.4$to2.77@news.oracle.com>
All,
I have the following code which throws "Use of uninitialized value in
undef operator at ....." when warnings is turned on. Can anyone please
explain this behaviour.
undef $ENV{'NLS_LANG'} if(defined $ENV{'NLS_LANG'});
Thanks,
Sunil.
------------------------------
Date: Mon, 06 Oct 2003 17:16:22 +1000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: why do I see - Use of uninitialized value in undef operator ...
Message-Id: <3f81177d$0$23584$5a62ac22@freenews.iinet.net.au>
Sunil wrote:
> All,
> I have the following code which throws "Use of uninitialized value in
> undef operator at ....." when warnings is turned on. Can anyone please
> explain this behaviour.
>
> undef $ENV{'NLS_LANG'} if(defined $ENV{'NLS_LANG'});
>
>
Can't explain it but the docs warn about it and tell you what to do
about it.
See:
perldoc -f undef
perldoc -f delete
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
------------------------------
Date: Mon, 6 Oct 2003 12:49:58 +0530
From: "Kasp" <kaspREMOVE_CAPS@epatra.com>
Subject: Re: why do I see - Use of uninitialized value in undef operator ...
Message-Id: <blr53e$r35$1@newsreader.mailgate.org>
"Sunil" <sunil_franklin@hotmail.com> wrote in message
news:AQ7gb.4$to2.77@news.oracle.com...
> I have the following code which throws "Use of uninitialized value in
> undef operator at ....." when warnings is turned on. Can anyone please
> explain this behaviour.
>
> undef $ENV{'NLS_LANG'} if(defined $ENV{'NLS_LANG'});
>
I tried the following code:
undef ($ENV{'SHELL'});
and got the same error message: "Use of uninitialized value in undef
operator..."
However, you could and rather should use this instead:
delete ($ENV{'SHELL'});
See perldoc -q undef
--
"Accept that some days you are the pigeon and some days the statue."
"A pat on the back is only a few inches from a kick in the butt." - Dilbert.
------------------------------
Date: Mon, 06 Oct 2003 09:50:15 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: why do I see - Use of uninitialized value in undef operator ...
Message-Id: <8e72ov0lhqah9v4rcvjfl3ogmrhjltqk6f@4ax.com>
On Mon, 6 Oct 2003 11:41:14 +0530, "Sunil"
<sunil_franklin@hotmail.com> wrote:
>All,
> I have the following code which throws "Use of uninitialized value in
>undef operator at ....." when warnings is turned on. Can anyone please
>explain this behaviour.
>
> undef $ENV{'NLS_LANG'} if(defined $ENV{'NLS_LANG'});
Don't use undef function(perldoc -f undef); if you want to delete key
then,
delete $ENV{'NLS_LANG'};
and
$ENV{'NLS_LANG'} = undef;
in case you want to set /value/ of $ENV{'NLS_LANG'} to undef.
------------------------------
Date: Mon, 6 Oct 2003 13:41:33 +0530
From: "Sunil" <sunil_franklin@hotmail.com>
Subject: Re: why do I see - Use of uninitialized value in undef operator ...
Message-Id: <hB9gb.4$3Q6.110@news.oracle.com>
Thanks a lot to all who replied.
delete $ENV{'NLS_LANG'};
has solved my problem.
Thanks Again,
Sunil.
"Matija Papec" <mpapec@yahoo.com> wrote in message
news:8e72ov0lhqah9v4rcvjfl3ogmrhjltqk6f@4ax.com...
> On Mon, 6 Oct 2003 11:41:14 +0530, "Sunil"
> <sunil_franklin@hotmail.com> wrote:
>
> >All,
> > I have the following code which throws "Use of uninitialized value in
> >undef operator at ....." when warnings is turned on. Can anyone please
> >explain this behaviour.
> >
> > undef $ENV{'NLS_LANG'} if(defined $ENV{'NLS_LANG'});
>
> Don't use undef function(perldoc -f undef); if you want to delete key
> then,
> delete $ENV{'NLS_LANG'};
> and
> $ENV{'NLS_LANG'} = undef;
> in case you want to set /value/ of $ENV{'NLS_LANG'} to undef.
>
>
------------------------------
Date: 6 Oct 2003 02:48:38 -0700
From: shlomif@vipe.technion.ac.il (Shlomi Fish)
Subject: Writing your own Presentation Tool
Message-Id: <deca99a9.0310060148.664cb219@posting.google.com>
Hi all!
I know that in Israel alone, at least 5 people (Gabor Szabo, Reuven
Lerner, Shlomo Yona, Alon Altman and I) wrote their own presentation
tools in Perl, at least one (Nadav Har'El) wrote one in zsh, and at
least one wrote it in Python.
Did any of you also rolled their own presentation tool instead of
using something that you found on the Net?
Regards,
Shlomi Fish
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
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 5621
***************************************