[22949] in Perl-Users-Digest
Perl-Users Digest, Issue: 5169 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 2 18:05:59 2003
Date: Wed, 2 Jul 2003 15:05:12 -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, 2 Jul 2003 Volume: 10 Number: 5169
Today's topics:
Re: Automatic page forwarding in cgi perl script (Max)
Re: Automatic page forwarding in cgi perl script <asu1@c-o-r-n-e-l-l.edu>
Re: Automatic page forwarding in cgi perl script <REMOVEsdnCAPS@comcast.net>
boolean expression regexp (zm)
Calculate next available IP (Jim)
Re: Calculate next available IP <glex_nospam@qwest.net>
Re: Calculate next available IP <sv99oya02@sneakemail.com>
Re: Capturing bracket surround numbers from a string (w <bigj@kamelfreund.de>
Re: Child signal behaviour on HPUX (Bryan Castillo)
Re: Devel::Coverage (James E Keenan)
Re: doing 'ref' on blessed reference <abigail@abigail.nl>
Re: executing "DB2 load command" from perl return error <ianbjor@mobileaudio.com>
Re: fork, childs, zombies, start a process in the backg <syscjm@gwu.edu>
Help with HTTPS 443 (Andrew)
Re: How would you mail yourself from XP <wsegrave@mindspring.com>
Re: installing perl modules via ftp (me)
k operator in REGEX?? <member31962@dbforums.com>
Re: k operator in REGEX?? <bigj@kamelfreund.de>
Re: k operator in REGEX?? <abigail@abigail.nl>
Re: k operator in REGEX?? <cwilbur@mithril.chromatico.net>
Re: k operator in REGEX?? <abigail@abigail.nl>
Re: k operator in REGEX?? <asu1@c-o-r-n-e-l-l.edu>
Re: k operator in REGEX?? <abigail@abigail.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Jul 2003 11:51:17 -0700
From: maximuszen@optonline.net (Max)
Subject: Re: Automatic page forwarding in cgi perl script
Message-Id: <3a9c1232.0307021051.2ba8fe56@posting.google.com>
Sinan,
That remark I wrote was intended towards a certain Jurgen Exner. I
read what you wrote in your message and I did post to the other group
as you advised. I appreciate the link you gave me, but it did not
solve the problem. My guess is that those who are making the sarcastic
remarks have some insight into the problem but rather than sharing
their knowledge as this forum is meant to be are just shooting their
smart mouths off. And the way the Usenet is set up it is not obvious
which groups are meant for what kind of material. Since nothing is
obvious.... This text is written in english. i'm on the third planet.
when you submit a response i will read it. and would appreciate a
reasonable response.
Respectfully,
Max
"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns93AC6BFDB7AE7asu1cornelledu@132.236.56.8>...
> maximuszen@optonline.net (Max) wrote in
> news:3a9c1232.0307020528.2643c250@posting.google.com:
>
> > "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
> > news:<NRqMa.68$C43.41@nwrddc04.gnilink.net>...
> >> Max wrote:
> >> > print ("Location:
> >> > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n"
> >> > );
> >> >
> >> > Why won't this work?
> >>
> >> Works just fine for me.
> >> It prints the text
> >> Location:
> >> http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html
> >>
> >> to STDOUT. Did you expect it to do anything else?
> >
> > wow, the sarcasm...
> >
> > what i want to do is forward to another page. i thought it was pretty
> > obvious.
>
> Nothing is obvious. You posted a line of code that does precisely what you
> asked it to do (print the text you specified) without describing a lot of
> pertinent details. You also posted to the wrong group ... From what I can
> understand, your problems are due to the fact that you are not sending a
> content type line. This is a CGI programming error, and has nothing to do
> with Perl.
>
> You can't get good answers without putting some effort into formulating
> your question. The posting guidelines for this group might help learn how:
>
> http://mail.augustmail.com/~tadmc/clpmisc.shtml
>
> Sinan.
------------------------------
Date: 2 Jul 2003 20:58:59 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Automatic page forwarding in cgi perl script
Message-Id: <Xns93ACACC3BFE96asu1cornelledu@132.236.56.8>
maximuszen@optonline.net (Max) wrote in
news:3a9c1232.0307021051.2ba8fe56@posting.google.com:
> "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message
> news:<Xns93AC6BFDB7AE7asu1cornelledu@132.236.56.8>...
>>
>> You can't get good answers without putting some effort into
>> formulating your question. The posting guidelines for this group
>> might help learn how:
...
> That remark I wrote was intended towards a certain Jurgen Exner. I
> read what you wrote in your message and I did post to the other group
> as you advised. I appreciate the link you gave me, but it did not
> solve the problem.
From http://hoohoo.ncsa.uiuc.edu/cgi/primer.html:
<blockquote>
If you want to reference another file (not protected by access
authentication) on your own server, you don't have to do nearly as much
work. Just output a partial (virtual) URL, such as the following:
Location: /dir1/dir2/myfile.html
The server will act as if the client had not requested your script, but
instead requested http://yourserver/dir1/dir2/myfile.html. It will take
care of most everything, such as looking up the file type and sending the
appropriate headers. Just be sure that you output the second blank line.
</blockquote>
Note the last sentence. Are you sure your code does that?
> My guess is that those who are making the sarcastic
> remarks have some insight into the problem but rather than sharing
> their knowledge as this forum is meant to be are just shooting their
> smart mouths off.
No one is supposed to try to guess the information you did not provide, and
you are suppose to do some of the work yourself. Since you have not given
any new information, it is hard to come up with new suggestions. Try and
give some context by providing a reasonable length script that exhibits the
problem.
Sinan.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: Wed, 02 Jul 2003 16:45:16 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Automatic page forwarding in cgi perl script
Message-Id: <Xns93ACB496A148Csdn.comcast@206.127.4.25>
maximuszen@optonline.net (Max) wrote in
news:3a9c1232.0307020543.272cc9d4@posting.google.com:
> thanks, i am awed by your brillant logic by analogy.
>
Anytime, Bub.
--
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
------------------------------
Date: 2 Jul 2003 14:44:43 -0700
From: zatan@myway.com (zm)
Subject: boolean expression regexp
Message-Id: <efc65930.0307021344.25cd6e40@posting.google.com>
Hello,
Does anyone know of any tool or code to convert a boolean expression
like:
(Aword and Bword* and (Dword or Cword*) into a regexp?
A, B ...are literal words, and * means that it can be part of another
word?
An final user of our tool is able to write the boolean expression, but
not the regexp one.
tia,
------------------------------
Date: 2 Jul 2003 11:17:56 -0700
From: jimnl69@hotmail.com (Jim)
Subject: Calculate next available IP
Message-Id: <3966ee66.0307021017.632aaad1@posting.google.com>
Is there a module, or a readily available algorithm, for calculating
the next available IP Address?
Let's say I have an array
('10.1.1.1','10.1.1.2','10.1.1.3','10.1.1.10'). I want to find that
the next available address is 10.1.1.4. Thanks.
J
------------------------------
Date: Wed, 02 Jul 2003 15:25:00 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: Calculate next available IP
Message-Id: <ZbHMa.908$yw3.47171@news.uswest.net>
Jim wrote:
> Is there a module, or a readily available algorithm, for calculating
> the next available IP Address?
>
> Let's say I have an array
> ('10.1.1.1','10.1.1.2','10.1.1.3','10.1.1.10'). I want to find that
> the next available address is 10.1.1.4. Thanks.
>
> J
Take a look at Net::Netmask. Using a few of the methods provided,
should help.
------------------------------
Date: Wed, 02 Jul 2003 23:00:32 +0200
From: =?ISO-8859-1?Q?Steffen_M=FCller?= <sv99oya02@sneakemail.com>
Subject: Re: Calculate next available IP
Message-Id: <bdvh57$hn8$1@news.rz.uni-karlsruhe.de>
Jim wrote:
> Is there a module, or a readily available algorithm, for calculating
> the next available IP Address?
>
> Let's say I have an array
> ('10.1.1.1','10.1.1.2','10.1.1.3','10.1.1.10'). I want to find that
> the next available address is 10.1.1.4. Thanks.
Hi Jim,
there may be such a module. I suggest you search CPAN for 'IP'.
Regardless, this is simple enough a task that a simple-minded approach
should do fine: (Sue me.)
use strict;
use warnings;
sub increment_ip ($) {
my $ip = shift;
my $i = 3;
while ($i >= 0) {
$ip->[$i]++;
if ($ip->[$i] > 255) {
$ip->[$i] = 0;
$i--;
}
else {
last;
}
}
return $ip;
}
sub decrement_ip ($) {
my $ip = shift;
my $i = 3;
while ($i >= 0) {
$ip->[$i]--;
if ($ip->[$i] < 0) {
$ip->[$i] = 255;
$i--;
}
else {
last;
}
}
return $ip;
}
sub compare_ips ($$) {
my $ip1 = shift;
my $ip2 = shift;
my $i = 0;
while ($i < 4) {
return -1 if $ip1->[$i] < $ip2->[$i];
return 1 if $ip1->[$i] > $ip2->[$i];
$i++;
}
return 0;
}
sub ip_iterator ($;\@) {
my $start = shift;
my $ary = shift || [];
$start = [map {0+$_} split /\./, $start];
@$ary = sort {
$a->[0] <=> $b->[0] ||
$a->[1] <=> $b->[1] ||
$a->[2] <=> $b->[2] ||
$a->[3] <=> $b->[3]
} map {
[map 0+$_, split /\./, $_]
} @$ary;
{
my $i = 0;
while (compare_ips($start, $ary->[$i]) == -1) {
shift @$ary;
$i++;
}
}
$start = decrement_ip $start;
return sub {
$start = increment_ip $start;
while (@$ary and not compare_ips $ary->[0], $start) {
$start = increment_ip $start;
shift @$ary;
}
return join '.', @$start;
};
}
# Here comes the code you need to care about:
my @ary = qw(10.1.1.1 10.1.1.2 10.1.1.3 10.1.1.10);
my $start = '10.1.1.1';
my $iter = ip_iterator $start, @ary;
foreach (1..20) {
print $iter->(), "\n";
}
The implementation should be fairly efficient once the iterator has been
generated as a closure.
Now, if I were to make this a module that lets you deal with those IP
array-refs themselves, I'd make them objects and possibly overload the
+, -, and <=> operators to look nicer than "increment_ip" and friends.
The code hasn't been thoroughly tested. (What about start values of
'0.0.0.0' or '255.255.255.255'? What about invalid input?)
If you want me to read any answers you post to comp.lang.perl.misc,
you'll need to send me a cc. I read this on comp.lang.perl.modules.
Steffen
--
@n=([283488072,6076],[2105905181,8583184],[1823729722,9282996],[281232,
1312416],[1823790605,791604],[2104676663,884944]);$b=6;@c=' -/\_|'=~/./g
;for(@n){for$n(@$_){map{$h=int$n/$b**$_;$n-=$b**$_*$h;$c[@c]=$h}reverse
0..11;push@p,map{$c[$_]}@c[reverse$b..$#c];$#c=$b-1}$p[@p]="\n"}print@p;
------------------------------
Date: Wed, 02 Jul 2003 17:30:02 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: Capturing bracket surround numbers from a string (was: Perl help needed)
Message-Id: <pan.2003.07.02.13.42.23.502005@kamelfreund.de>
Saya wrote at Wed, 02 Jul 2003 06:44:10 -0700:
> I am a newbie to perl and regular expressions.
The language is called Perl.
Please read
perldoc -q 'difference between "Perl" and "perl"'
> I need help with extracting a substring.
> Presume:
> $test = "thisIsATest(12)";
> $subPar = should equal to (12)
> $num = should equal to 12
Do you mean you want everything between brackets in $subPar and
the interior content of them in $num.
That question seems to be stupid, but it's important to have an exacat
definition of the possible input and the wanted output.
What happens if there are more than one bracket? (e.g. "test (1) (2) (3)")
What when there are also not-numbers inside? (e.g. "test (12 pound)")
> How do I achieve this in perl ? Do I use regular expression ?
>
> Any help would be appreciated.
What have you tried so far?
A solution would be
my ($subPar, $num) = $test =~ /( \( (.*) \) )/x;
There might be some problems depending on the exact definition.
However, you should really read at least a regexp tutorial, like
perldoc perlrequick
perldoc perlretut
perldoc perlre
Greetings,
Janek
------------------------------
Date: 2 Jul 2003 12:19:58 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: Child signal behaviour on HPUX
Message-Id: <1bff1830.0307021119.459748f9@posting.google.com>
jom_es@yahoo.es (Jorge) wrote in message news:<f580ae77.0307010438.3271371f@posting.google.com>...
> All,
>
> I've got a process that creates some children and want to be alerted
> when they die. To do this, the SIGCHLD signal is registered in the
> process using sigaction to jump to a subprogram as soon as it's
> received.
>
> The problem comes when many children exit at the same time and their
> father seems to miss some of them. This happens quite often, but not
> always.
>
I noticed this problem on linux using the sigqueue function. I was
writing
in C. On Solaris, I never missed signals.
I don't think you can consider signals reliable. Some of them
will be dropped. I went looking through the linux source a while ago
trying to figure out why. It looked like the kernel would skip
delivering a signal if the task struct for the process already had
that same signal marked for delivery on the process. So, if 2 signals
were delivered before the first was handled, the process would only
know
1 signal was delivered. Perhpas HPUX is similar.
Here is a thread where I was writing about this:
(I don't think I explained it too well then and I still dont know if I
was
right)
http://cboard.cprogramming.com/showthread.php?s=82cb29395563f7d85efb543d23ae3a96&threadid=8137&highlight=sigqueue+linux
You might want to do periodic checks of the pids you know you started,
using the non-blocking version of waitpid.
> Why are the signals being missed? I'm pretty sure it's something with
> the flags on sigaction, but I've tryed several options and it's always
> the same.
>
If you really want to explore this, you should check with people in
comp.unix.programmer, etc....
> I appreciate your suggestions. Thanks in advance.
>
> PS: Perl 2.5.1, hpux 11.00
You are joking about perl 2.5.1 right? How old would that be?
<snip code>
------------------------------
Date: 2 Jul 2003 13:58:13 -0700
From: jkeen@concentric.net (James E Keenan)
Subject: Re: Devel::Coverage
Message-Id: <b955da04.0307021258.5b01e5a3@posting.google.com>
himal5@hotmail.com (Himal) wrote in message news:<365e1935.0307020447.57c48e88@posting.google.com>...
> Well it was my error in using Devel::Coverage that was giving me
> problems.
>
> I have downloaded Devel-Coverage-0.2.gz from CPAN and the README in it
> explains it rather simply how to go about it.
>
> There do seem to be an issue using it with perl 5.8.0.
>
I took a look at this myself. Note that version 0.2 has not been
updated since July 2000 (predating Perl 5.8 by 23 months) and did not
include *any* tests in its distribution. Having no tests, it never
passed any installation tests conducted by CPAN testers. If you have
further problems with it, you will have no choice but to contact the
module's author directly -- and hope he is still maintaining it!
Jim Keenan
------------------------------
Date: 02 Jul 2003 19:01:32 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <slrnbg6b0c.mu3.abigail@alexandra.abigail.nl>
Malte Ubl (ubl@schaffhausen.de) wrote on MMMDXCII September MCMXCIII in
<URL:news:bduuj4$3vc$1@news.dtag.de>:
<> Abigail wrote:
<>
<> > Martien Verbruggen (mgjv@tradingpost.com.au) wrote on MMMDXCI September
<> > MCMXCIII in <URL:news:slrnbg224d.3er.mgjv@verbruggen.comdyn.com.au>:
<> > ~~ On Tue, 01 Jul 2003 02:01:48 GMT,
<> > ~~ JT <woland99@earthlink.net> wrote:
<> > ~~ > If we do 'ref' on blessed reference it return string that is the name of
<> > ~~ > the class
<> > ~~ > but how can I know if this was a hash, array or sth else? Is there a way to
<> > ~~ > return ARRAY, HASH or SCALAR for blessed reference?
<> > ~~
<> > ~~ First of all: Why do you think you need to know? One of the main
<> > ~~ advantages of OO programming is the encapsulation of the
<> > ~~ implementationof the object, internally. Outside the class, or one of
<> > ~~ its subclasses, you should not care what the implementation is.
<> > ~~ Whenever you find yourself wondering whether you should know something
<> > ~~ about the internal implementation of a class, you should think really
<> > ~~ hard about whether you should be asking a different question.
<> >
<> > Oh, come on! The majority of the Perl classes that subclass something
<> > depends on the implementation of the superclass, and will break if it
<> > changes. About 99% of the inheriting classes assume the class they are
<> > inheriting uses a hashref to implement the object.
<>
<> On the other hand, if you consider the object being a hashref part of
<> the interface (as opposed to purely a part of the implementation) which
<> is theoratically always the case if you are using a hashref as the basis
<> of an object, you should overload %{} when you change your
<> implementation so that your interface stays the same.
Rare are those object that would document this - and they should also
document the attribute they are using, if you want to make it part of the
interface.
But this is convenient. Just consider everything part of the interface,
and noone bothers about encapsulation anymore. Yeah. That will Java
people get hooked on Perl.
Abigail
--
@_=map{[$!++=>$_^$/]}split$²=>"\@\x7Fy~*kde~box*Zoxf*Bkiaox";$\="\r";
$|=++$*;do{($#=>$=)=(rand@_=>rand@_);@_[$#,$=]=@_[$=,$#]}for($*..@_);
for$:($|..@_-$|){for($|..@_-$:){@_[$_-$|,$_]=@_[$_=>$_-$*]if$_[$_][$¼
]<$_[$_-$*][$®];print+map{$_->[$|]}@_;select$·,$°,$½,"$[.$|"}}print$/
------------------------------
Date: Wed, 2 Jul 2003 11:39:17 -0700
From: "Ian D. Bjorhovde" <ianbjor@mobileaudio.com>
Subject: Re: executing "DB2 load command" from perl return errors
Message-Id: <Pine.LNX.4.44.0307021136160.25751-100000@sidi.phx.dataproxy.com>
On 2 Jul 2003, Kenjis Kaan wrote:
> I see what you mean now. This is bad! from the solution that I have
> available that is. I wonder if there is another way around what I
> need to do. Your suggestions above is fine if the database is on the
> same machine where I am running. Exception when in production the
> perl script is on one machine and the database on another one. As far
> as I know your solution assume the database is also on the same
> machine. That being said, anyone know of a solution for this problem?
You can use the CLIENT option for LOAD, which allows you to load data that
resides on the client machine instead of the server.
i.e. db2 load client from ...
This is documented in the Data Movement Utilities Guide.
If you know C you could write a stored procedure that calls the LOAD API
to load a file that exists on the remote server.
Good luck,
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Wed, 02 Jul 2003 12:37:37 -0400
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: fork, childs, zombies, start a process in the background without waiting for it
Message-Id: <3F030A51.1070703@gwu.edu>
Rex Gustavus Adolphus wrote:
> BTW, whats "YMMV"?
"Your Mileage May Vary"; i.e., it works for me, but I don't guarantee it'll
work for you.
Chris Mattern
------------------------------
Date: 2 Jul 2003 08:14:32 -0700
From: kx@peterlink.ru (Andrew)
Subject: Help with HTTPS 443
Message-Id: <a87ac51e.0307020714.219d0d71@posting.google.com>
I need simple example code for send file, for example index.html.gz,
to HTTPS SSLv3 server (443 port) with POST request. And how use
autorization with CA key.
When I can get info for this item.
Thanks.
------------------------------
Date: Wed, 2 Jul 2003 11:43:47 -0500
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: How would you mail yourself from XP
Message-Id: <bdv2c8$ms7$1@slb3.atl.mindspring.net>
"Helgi Briem" <helgi@decode.is> wrote in message
news:3f02a5ec.778542609@news.cis.dfn.de...
> On Tue, 1 Jul 2003 19:36:04 -0500, "William Alexander Segraves"
> <wsegrave@mindspring.com> wrote:
>
> >> I wouldn't use an external 'mail' program.
> >
> >Note to OP: Use Mime::Lite, as suggested by Mr. Briem.
> >You will no doubt find it to be an expedient and pleasing
> >solution.
>
> Note to OP: I suggested MIME::Lite, not Mime::Lite.
>
> Case matters, Bill. ;-)
>
Indeed it does. Thanks for catching my error, Helgi. My apologies for
unwittingly attributing the error to you.
Notes to OP:
Please take "as suggested by Mr. Briem" quite literally, i.e., MIME::Lite,
not Mime::Lite.
On Windows systems, the OP should ensure the case matches exactly what is
given in the package name, despite the fact that Windows might show case
differences in the directory and file names, as they appear when examined
with "My Computer".
Thanks again, Helgi, for the clarification.
Cheers.
Bill Segraves
------------------------------
Date: 2 Jul 2003 10:15:57 -0500
From: me@me.com (me)
Subject: Re: installing perl modules via ftp
Message-Id: <3f02f72d_7@corp.newsgroups.com>
Thanks, Sinan!
This is what I needed. I'll give it a whirl.
In article <Xns93AC7098C23CAasu1cornelledu@132.236.56.8>,
asu1@c-o-r-n-e-l-l.edu says...
>
>me@me.com (me) wrote in news:3f02ed5d_7@corp.newsgroups.com:
>
>> My Web host won't install the WebDB::Session module from Paul DuBois's
>> Book MySQL and Perl for the Web, but told me I could install it to my
>> account locally.
>>
>> Does anyone have a clue how? As it is, I install Perl scripts to a
>> CGI-BIN folder via FTP. HELP!
>
>You can put the modules you would like to use in a directory, for
>example,
>
>/home/mysite/lib
>
>and then put a line with:
>
>use lib '/home/mysite/lib';
>
>in your script. You need to replace /home/mysite with the complete path
>to whereever you put your stuff on the host. You also need to preserve
>the directory structure for modules you put there. For example, the
>module you mentioned would be installed as
>
>/home/mysite/lib/WebDB/Session.pm
>
>For more information, take a look at perldoc -q lib
>
>Sinan.
>
>--
>A. Sinan Unur
>asu1@c-o-r-n-e-l-l.edu
>Remove dashes for address
>Spam bait: mailto:uce@ftc.gov
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Wed, 02 Jul 2003 18:19:11 +0000
From: darkname <member31962@dbforums.com>
Subject: k operator in REGEX??
Message-Id: <3068040.1057169951@dbforums.com>
Hello everyone!
Can somenone tell me what the following regex means?
"(?k:(?k:$_[0])(?k:[^\\n]*)(?k:\\n))"
what is the k?? What does it means??
This gives me errors!!
Thank you all...
--
Posted via http://dbforums.com
------------------------------
Date: Wed, 02 Jul 2003 17:29:08 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: k operator in REGEX??
Message-Id: <pan.2003.07.02.15.29.07.390619@kamelfreund.de>
darkname wrote at Wed, 02 Jul 2003 18:19:11 +0000:
> Can somenone tell me what the following regex means?
>
> "(?k:(?k:$_[0])(?k:[^\\n]*)(?k:\\n))"
>
> what is the k?? What does it means??
I would say it's nonsense.
I've never seen it in Perl <= 5.8.0 and a simple
perldoc perlre | grep '(?k'
contains also nothing.
> This gives me errors!!
It really should.
BTW: The whole re makes sense if you remove all the k's.
Greetings,
Janek
------------------------------
Date: 02 Jul 2003 19:36:11 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: k operator in REGEX??
Message-Id: <slrnbg6d1b.mu3.abigail@alexandra.abigail.nl>
darkname (member31962@dbforums.com) wrote on MMMDXCII September MCMXCIII
in <URL:news:3068040.1057169951@dbforums.com>:
**
** Hello everyone!
**
** Can somenone tell me what the following regex means?
**
** "(?k:(?k:$_[0])(?k:[^\\n]*)(?k:\\n))"
**
** what is the k?? What does it means??
Nothing.
** This gives me errors!!
As it should.
** Thank you all...
I guess you've cut and pasted this from Regexp::Common. It's fine if you
want to do that, instead of using $RE{...}{....}, but you should know
what Regexp::Common is doing with the strings returned by the pattern
function. They are being post-processed. If the -keep option is present,
'(?k:' becomes '('. Otherwise, '(?k:' becomes '(?:'.
The regex you lifted is from the function Regexp::Common::comment::to_eol,
which is only used as a helper sub to create full expressions with.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: Wed, 02 Jul 2003 20:59:22 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: k operator in REGEX??
Message-Id: <8765mkslic.fsf@mithril.chromatico.net>
Abigail <abigail@abigail.nl> writes:
> perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
> % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
> BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
I think my brain is melting.
Charlton
------------------------------
Date: 02 Jul 2003 21:07:47 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: k operator in REGEX??
Message-Id: <slrnbg6id3.mu3.abigail@alexandra.abigail.nl>
Charlton Wilbur (cwilbur@mithril.chromatico.net) wrote on MMMDXCII
September MCMXCIII in <URL:news:8765mkslic.fsf@mithril.chromatico.net>:
"" Abigail <abigail@abigail.nl> writes:
""
"" > perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
"" > / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
"" > % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
"" > BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
""
"" I think my brain is melting.
I gave a talk about this one two years ago on YAPC, and the punchline
for this JAPH is: "The question is not what it does, but why does it
compile?".
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: 2 Jul 2003 21:36:03 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: k operator in REGEX??
Message-Id: <Xns93ACB30C515C4asu1cornelledu@132.236.56.8>
Abigail <abigail@abigail.nl> wrote in
news:slrnbg6id3.mu3.abigail@alexandra.abigail.nl:
> I gave a talk about this one two years ago on YAPC, and the punchline
> for this JAPH is: "The question is not what it does, but why does it
> compile?".
Being a newbie, I am very curious about what the heck is going on in those
few lines. Is there an online reference to that talk and if not, would you
mind explaining it a little.
Sinan.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: 02 Jul 2003 21:55:25 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: k operator in REGEX??
Message-Id: <slrnbg6l6d.mu3.abigail@alexandra.abigail.nl>
A. Sinan Unur (asu1@c-o-r-n-e-l-l.edu) wrote on MMMDXCII September
MCMXCIII in <URL:news:Xns93ACB30C515C4asu1cornelledu@132.236.56.8>:
\\ Abigail <abigail@abigail.nl> wrote in
\\ news:slrnbg6id3.mu3.abigail@alexandra.abigail.nl:
\\
\\ > I gave a talk about this one two years ago on YAPC, and the punchline
\\ > for this JAPH is: "The question is not what it does, but why does it
\\ > compile?".
\\
\\ Being a newbie, I am very curious about what the heck is going on in those
\\ few lines. Is there an online reference to that talk and if not, would you
\\ mind explaining it a little.
http://perl.abigail.nl/Talks/Japhs/ and
http://perl.abigail.nl/Talks/Japhs-II/
I think the one you are asking about is discussed in the former talk.
Abigail
--
perl -wle 'eval {die [[qq [Just another Perl Hacker]]]};; print
${${${@}}[$#{@{${@}}}]}[$#{${@{${@}}}[$#{@{${@}}}]}]'
------------------------------
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 5169
***************************************