Perl6 though IIS7 CGI
am 06.04.2009 18:45:25 von lyle
Hi All,
I know this is a bit off topic, but I couldn't think of a list that
would have as much IIS/CGI knowledge as you guys.
I'm trying to get the latest build of Rakudo Perl 6 to run as a CGI
through IIS7 on my Vista32 machine.
At first I thought it might be something in my code, but after trying
several things I tried it under Apache on the same machine and it worked
fine. It's a very basic hello script:-
#!c:/temp/rakudo/perl6.exe
$*ERR = open("C:/inetpub/wwwroot/cgi-bin/perl6/err.txt", :w);
my $crlf = "\x[0D]\x[0A]";
$*OUT.say( "Content-Type: text/html$crlf$crlf" );
$*OUT.say( 'hello' );
#$*ERR.say( 'hello' );
I've had problems in the past with IIS treating STDERR the same as
STDOUT, which is why I've redirected it to a file to see if any errors
were coming out (which there aren't).
I thought things might not be going to STDOUT for some reason which is
why the content-type, etc, is sent explicitly to $*OUT. But this made no
difference.
The Perl6.exe file is configured in IIS in exactly the same way as Perl.exe.
If I run this through the browser I get a 502 error. If I run it on the
command prompt it returns the headers as expected. If I uncomment the
#$*ERR.say( 'hello' ); on the end and run through the browser then
err.txt is being filled with 'hello' so I know the script it definitely
being executed.
I can't figure out why IIS isn't picking up the headers? It doesn't seem
to be picking up any of the program output as it says headers returned
were "".
I've started a thread on the IIS.net forum about this as well:-
http://forums.iis.net/p/1156635/1899524.aspx
Jan, I know you did an awful lot of the work to get Perl 5 working well
under IIS. Is there anything that springs to mind that Perl6 needs to be
doing for this to work?
Lyle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 03:01:17 von Xiao Yafeng
I know my English is not well, but I guess s/awful/awesome/ ?
On 4/7/09, Lyle wrote:
> Hi All,
> I know this is a bit off topic, but I couldn't think of a list that
> would have as much IIS/CGI knowledge as you guys.
>
> I'm trying to get the latest build of Rakudo Perl 6 to run as a CGI
> through IIS7 on my Vista32 machine.
>
> At first I thought it might be something in my code, but after trying
> several things I tried it under Apache on the same machine and it worked
> fine. It's a very basic hello script:-
>
> #!c:/temp/rakudo/perl6.exe
>
> $*ERR = open("C:/inetpub/wwwroot/cgi-bin/perl6/err.txt", :w);
> my $crlf = "\x[0D]\x[0A]";
> $*OUT.say( "Content-Type: text/html$crlf$crlf" );
> $*OUT.say( 'hello' );
> #$*ERR.say( 'hello' );
>
> I've had problems in the past with IIS treating STDERR the same as
> STDOUT, which is why I've redirected it to a file to see if any errors
> were coming out (which there aren't).
>
> I thought things might not be going to STDOUT for some reason which is
> why the content-type, etc, is sent explicitly to $*OUT. But this made no
> difference.
>
> The Perl6.exe file is configured in IIS in exactly the same way as Perl.exe.
>
> If I run this through the browser I get a 502 error. If I run it on the
> command prompt it returns the headers as expected. If I uncomment the
> #$*ERR.say( 'hello' ); on the end and run through the browser then
> err.txt is being filled with 'hello' so I know the script it definitely
> being executed.
>
> I can't figure out why IIS isn't picking up the headers? It doesn't seem
> to be picking up any of the program output as it says headers returned
> were "".
>
> I've started a thread on the IIS.net forum about this as well:-
>
> http://forums.iis.net/p/1156635/1899524.aspx
>
> Jan, I know you did an awful lot of the work to get Perl 5 working well
> under IIS. Is there anything that springs to mind that Perl6 needs to be
> doing for this to work?
>
>
> Lyle
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 03:17:06 von fzarabozo
I think he meant Jan did a lot of the really hard work and is calling awful
the hard part, the nasty part that needed work, not the work Jan
accomplished. But yes, just as it is now, seems like he called awful a lot
of Jan's work. Not with that intention, I want to think.
:-)
--------------------------------------------------
From: "Xiao Yafeng"
> I know my English is not well, but I guess s/awful/awesome/ ?
> On 4/7/09, Lyle wrote:
>> Jan, I know you did an awful lot of the work to get Perl 5 working well
>> under IIS. Is there anything that springs to mind that Perl6 needs to be
>> doing for this to work?
>>
>>
>> Lyle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl6 though IIS7 CGI
am 07.04.2009 03:27:53 von Justin Allegakoen
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Xiao
Yafeng
Sent: Tuesday, 7 April 2009 9:01 AM
To: Lyle
Cc: ActivePerl@listserv.ActiveState.com
Subject: Re: Perl6 though IIS7 CGI
I know my English is not well, but I guess s/awful/awesome/ ?
On 4/7/09, Lyle wrote:
> Hi All,
> I know this is a bit off topic, but I couldn't think of a list that
> would have as much IIS/CGI knowledge as you guys.
>
> I'm trying to get the latest build of Rakudo Perl 6 to run as a CGI
> through IIS7 on my Vista32 machine.
>
> At first I thought it might be something in my code, but after trying
> several things I tried it under Apache on the same machine and it worked
> fine. It's a very basic hello script:-
>
> #!c:/temp/rakudo/perl6.exe
>
> $*ERR = open("C:/inetpub/wwwroot/cgi-bin/perl6/err.txt", :w);
> my $crlf = "\x[0D]\x[0A]";
> $*OUT.say( "Content-Type: text/html$crlf$crlf" );
> $*OUT.say( 'hello' );
> #$*ERR.say( 'hello' );
>
> I've had problems in the past with IIS treating STDERR the same as
> STDOUT, which is why I've redirected it to a file to see if any errors
> were coming out (which there aren't).
>
> I thought things might not be going to STDOUT for some reason which is
> why the content-type, etc, is sent explicitly to $*OUT. But this made no
> difference.
>
> The Perl6.exe file is configured in IIS in exactly the same way as
Perl.exe.
>
> If I run this through the browser I get a 502 error. If I run it on the
> command prompt it returns the headers as expected. If I uncomment the
> #$*ERR.say( 'hello' ); on the end and run through the browser then
> err.txt is being filled with 'hello' so I know the script it definitely
> being executed.
>
> I can't figure out why IIS isn't picking up the headers? It doesn't seem
> to be picking up any of the program output as it says headers returned
> were "".
>
> I've started a thread on the IIS.net forum about this as well:-
>
> http://forums.iis.net/p/1156635/1899524.aspx
>
> Jan, I know you did an awful lot of the work to get Perl 5 working well
> under IIS. Is there anything that springs to mind that Perl6 needs to be
> doing for this to work?
>
>
> Lyle
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Lyle,
I havent played too much with perl6 or IIS7, but I would hazard a guess that
the open on err.txt is failing. Have you tried a bare bones version without
opening any files? i.e. just printing out the Content-Type and hello with
say without any filehandles prepended.
Xiao,
Awful in this context means that there was a lot of work done. Lyle is
actually complementing Jan on his hard work believe it or not!
Just in
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 03:34:02 von Bill Luebkert
Francisco Zarabozo wrote:
> I think he meant Jan did a lot of the really hard work and is calling awful
> the hard part, the nasty part that needed work, not the work Jan
> accomplished. But yes, just as it is now, seems like he called awful a lot
> of Jan's work. Not with that intention, I want to think.
>
> :-)
You guys are complicating it - awful can be used to just mean an intensifier -
like 'amazing', etc.
adv : used as intensifiers; "terribly interesting"; "I'm awful
sorry" [syn: {terribly}, {awfully}, {frightfully}]
Just substitute 'awful lot' => 'a whole bunch'.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
PERL Pattern matching
am 07.04.2009 10:50:03 von Conor Lillis
Hi all,
I have a requirement to match a file against a number of possible
strings.
I also need to retain the successfully matching elements, and based on
the match from the primary list, see if a corresponding secondary match
is also in the file.
E.g.. Picture the list below
A B
---------
1 a
2 b
3 c
4 d
5 e
6 f
I need to match any of the first column in the file, and for any matches
in the first row match the corresponding entry for the second column.
So if I match 3 and 5 in the file, I rescan and see if I can match c or
e in the same file.
Here is a snippet of how I am matching anything from column A, and then
rescanning for only corresponding entries from column B.
Is there a more efficient method than what I am doing here?
while()
{
foreach my $string (@strings)
{
if (grep /$string/i, $_)
{
$primary =++$primary;
if (!grep /$string/i,
@matchindex){push(@matchindex, "$string");}
print gmtime()."\"$file\" matched on primary -
$string\n";
}
}
}
close(FILE);
if (@matchindex)
{
# GetSecondaries() Reads array to get 2nd column entries for
primary matches by splitting row on seperators
my @matches = GetSecondaries(@matchindex);
open(FILE, $file);
LOOP: while()
{
foreach my $string (@matches)
{
if (grep /$string/i, $_)
{
$secondarycounter = ++$secondarycounter;
print gmtime()."********\t: Also matched
on secondary - $string\n";
logger("$string,$file"); #
Logs output to a log file
last LOOP;
}
}
}
close(FILE);
************************************************************ **********
Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. If you have received this e-mail or any file or attachment transmitted with it in error please notify Anglo Irish Bank Corporation Limited, Stephen Court, 18/21 St Stephen's Green, Dublin 2, Ireland, telephone no
: +353-1-6162000.
Directors: D O'Connor (Chairman), F Daly, A Dukes, M Keane, D Quilligan.
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2 Ireland
Registered in Ireland: No 22045
Anglo Irish Bank Corporation Limited is regulated by the Financial Regulator. Anglo Irish Bank Corporation Limited (trading as Anglo Irish Bank Private Banking) is regulated by the Financial Regulator. Anglo Irish Assurance Company Limited is regulated by the Financial Regulator.
************************************************************ **********
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 13:28:49 von lyle
Justin Allegakoen wrote:
>> Hi All,
>> I know this is a bit off topic, but I couldn't think of a list that
>> would have as much IIS/CGI knowledge as you guys.
>>
>> $*ERR = open("C:/inetpub/wwwroot/cgi-bin/perl6/err.txt", :w);
>> my $crlf = "\x[0D]\x[0A]";
>> $*OUT.say( "Content-Type: text/html$crlf$crlf" );
>> $*OUT.say( 'hello' );
>> #$*ERR.say( 'hello' );
>>
>>
> Lyle,
>
> I havent played too much with perl6 or IIS7, but I would hazard a guess that
> the open on err.txt is failing. Have you tried a bare bones version without
> opening any files? i.e. just printing out the Content-Type and hello with
> say without any filehandles prepended.
>
I started with a very simple script, that didn't work. I added in the
extra stuff to see what is going on. The open on err.txt is working to
as the file gets written to. As far as I can tell it executes and
completes as it should, just IIS doesn't pickup any of the output. This
is what I started with:-
#!c:/temp/rakudo/perl6.exe
say( "Content-Type: text/html\r\n\r\n" );
say( 'hello' );
As I said, they all work on Vista/Apache.
Lyle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: PERL Pattern matching
am 07.04.2009 14:53:52 von Justin Allegakoen
2009/4/7 Conor Lillis :
> Hi all,
> I have a requirement to match a file against a number of possible
> strings.
> I also need to retain the successfully matching elements, and based on
> the match from the primary list, see if a corresponding secondary match
> is also in the file.
>
> E.g.. Picture the list below
>
> A =A0 =A0 =A0 B
> ---------
> 1 =A0 =A0 =A0 a
> 2 =A0 =A0 =A0 b
> 3 =A0 =A0 =A0 c
> 4 =A0 =A0 =A0 d
> 5 =A0 =A0 =A0 e
> 6 =A0 =A0 =A0 f
>
> I need to match any of the first column in the file, and for any matches
> in the first row match the corresponding entry for the second column.
> So if I match 3 and 5 in the file, I rescan and see if I can match c or
> e in the same file.
>
> Here is a snippet of how I am matching anything from column A, and then
> rescanning for only corresponding entries from column B.
> Is there a more efficient method than what I am doing here?
>
> while()
> {
> =A0 =A0 =A0 =A0foreach my $string (@strings)
> =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (grep /$string/i, $_)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0$primary =3D++$primary;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!grep /$string/i,
> @matchindex){push(@matchindex, "$string");}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0print gmtime()."\"$file\" =
matched on primary -
> $string\n";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0}
> }
> close(FILE);
> if (@matchindex)
> {
> # =A0 =A0 =A0 GetSecondaries() Reads array to get 2nd column entries for
> primary matches by splitting row on seperators
> =A0 =A0 =A0 =A0my @matches =3D GetSecondaries(@matchindex);
> =A0 =A0 =A0 =A0open(FILE, $file);
> =A0 =A0 =A0 =A0LOOP: while()
> =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0foreach my $string (@matches)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (grep /$string/i, $_)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0$secondary=
counter =3D ++$secondarycounter;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0print gmti=
me()."********\t: Also matched
> on secondary - $string\n";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0logger("$s=
tring,$file"); =A0 =A0 =A0 =A0#
> Logs output to a log file
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0last LOOP;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> }
> close(FILE);
I doubt your data is as simplistic as you describe which is why I miss
the point of 'rescanning' the data for a 2nd time after the first
match. Based on your example is there a possibility that say 3 from
column A could relate to anything other than 'c'?
Looking at your sample the i modifier in the grep in the foreach is a
prime candidate for hashes and the exists function. Have a look at
perldsc which may give you some ideas of how your data structure
should really appear.
If that doesn't help and the others on the list can't see what you're
after then sanitise some of the real data (I'm sure its confidential
looking at your e-mail address ; ) and re-describe the end desired
result - which most probably involves account numbers and the amount
of times they have used their debit facility : p
Just in
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 15:07:36 von Deane.Rothenmaier
This is a multipart message in MIME format.
--===============1170144094==
Content-Type: multipart/alternative;
boundary="=_alternative 0048201E86257591_="
This is a multipart message in MIME format.
--=_alternative 0048201E86257591_=
Content-Type: text/plain; charset="US-ASCII"
Francisco,
My guess is that, with his English deficiency, he substituted awful for
awesome, thinking they had synonymous denotations. Or, mayhap he read
"awful" as being "awe-ful," meaning the same as awesome.....
My $0.02.
Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
224-542-5150
Everything should be made as simple as possible...but not simpler. -
Albert Einstein
--=_alternative 0048201E86257591_=
Content-Type: text/html; charset="US-ASCII"
Francisco,
My guess is that, with his English deficiency,
he substituted awful for awesome, thinking they had synonymous denotations.
Or, mayhap he read "awful" as being "awe-ful," meaning
the same as awesome.....
My $0.02.
Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
224-542-5150
Everything should be made as simple as possible...but not simpler. - Albert
Einstein
--=_alternative 0048201E86257591_=--
--===============1170144094==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1170144094==--
RE: PERL Pattern matching
am 07.04.2009 15:15:41 von Conor Lillis
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounce=
s@listserv.ActiveState.com] On Behalf Of Justin Allegakoen
Sent: 07 April 2009 13:54
To: ActivePerl@listserv.ActiveState.com
Subject: Re: PERL Pattern matching
2009/4/7 Conor Lillis :
> Hi all,
> I have a requirement to match a file against a number of possible =
> strings.
> I also need to retain the successfully matching elements, and based on =
> the match from the primary list, see if a corresponding secondary =
> match is also in the file.
>
> E.g.. Picture the list below
>
> A =A0 =A0 =A0 B
> ---------
> 1 =A0 =A0 =A0 a
> 2 =A0 =A0 =A0 b
> 3 =A0 =A0 =A0 c
> 4 =A0 =A0 =A0 d
> 5 =A0 =A0 =A0 e
> 6 =A0 =A0 =A0 f
>
> I need to match any of the first column in the file, and for any =
> matches in the first row match the corresponding entry for the second col=
umn.
> So if I match 3 and 5 in the file, I rescan and see if I can match c =
> or e in the same file.
>
> Here is a snippet of how I am matching anything from column A, and =
> then rescanning for only corresponding entries from column B.
> Is there a more efficient method than what I am doing here?
>
> while()
> {
> =A0 =A0 =A0 =A0foreach my $string (@strings)
> =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (grep /$string/i, $_)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0$primary =3D++$primary;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!grep /$string/i, =
> @matchindex){push(@matchindex, "$string");}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0print gmtime()."\"$file\" =
matched on primary - =
> $string\n";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0}
> }
> close(FILE);
> if (@matchindex)
> {
> # =A0 =A0 =A0 GetSecondaries() Reads array to get 2nd column entries for =
> primary matches by splitting row on seperators
> =A0 =A0 =A0 =A0my @matches =3D GetSecondaries(@matchindex);
> =A0 =A0 =A0 =A0open(FILE, $file);
> =A0 =A0 =A0 =A0LOOP: while()
> =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0foreach my $string (@matches)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (grep /$string/i, $_)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0$secondary=
counter =3D =
> ++$secondarycounter;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0print gmti=
me()."********\t: Also =
> matched on secondary - $string\n";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0logger("$s=
tring,$file"); =A0 =A0 =A0 =A0# Logs =
> output to a log file
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0last LOOP;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> }
> close(FILE);
I doubt your data is as simplistic as you describe which is why I miss the =
point of 'rescanning' the data for a 2nd time after the first match. Based =
on your example is there a possibility that say 3 from column A could relat=
e to anything other than 'c'?
Looking at your sample the i modifier in the grep in the foreach is a prime=
candidate for hashes and the exists function. Have a look at perldsc which=
may give you some ideas of how your data structure should really appear.
If that doesn't help and the others on the list can't see what you're after=
then sanitise some of the real data (I'm sure its confidential looking at =
your e-mail address ; ) and re-describe the end desired result - which most=
probably involves account numbers and the amount of times they have used t=
heir debit facility : p
Just in
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Justin
Thanks for the response. I am scanning randomly formatted text files to see=
if any of the elements in column A appear. For those that do appear, I am =
rescanning the file for the corresponding values in column B. In some cases=
there are multiple matches in column B for a value in column A, but I mana=
ge that using the function GetSecondaries() that is not included, but this =
element is working fine (accurately and quickly) from debugging it previous=
ly.
The reason for the rescan is that using the while() read statement I =
am already at the end of the file when I know how many matches for column A=
I have, and for all matches I have to rescan the file for the related valu=
es in column B. I need to know all matches for col. A before I can rescan f=
or column B matches.
Part of the issue may be that I have 130 "pairs" of data to scan for. Howev=
er the analysis on a 2 MB file is taking 70 seconds, just on column A value=
s, so that suggests grepping against the $_ variable while reading the file=
is not economic. My server is a new Win2003 file server with 3GB RAM and 4=
CPU so hardware performance should really not be a bottleneck. Perl seems =
to sit on one CPU looking at task manager, the CPU usage doesn't exceed 25%=
(RAM utilisation is also very little).
What I guess I am really hoping for is a more economic method to read the f=
ile and match any of the 130 primary elements of the array against the file=
, but retain the matching values for re-use in the 2nd loop. =
Perhaps grep is not the most appropriate mechanism to use for this type of =
retrieval?
It is an unusual request I agree. What I can do is generate a test data fil=
e and upload the whole script & data file for completeness if this is any u=
se in clarifying what I am trying to achieve..
Conor
************************************************************ **********
Private, Confidential and Privileged. This e-mail and any files and attachm=
ents transmitted with it are confidential and/or privileged. They are inten=
ded solely for the use of the intended recipient. The content of this e-mai=
l and any file or attachment transmitted with it may have been changed or a=
ltered without the consent of the author. If you are not the intended recip=
ient, please note that any review, dissemination, disclosure, alteration, p=
rinting, circulation or transmission of this e-mail and/or any file or atta=
chment transmitted with it, is prohibited and may be unlawful. If you have =
received this e-mail or any file or attachment transmitted with it in error=
please notify Anglo Irish Bank Corporation Limited, Stephen Court, 18/21 S=
t Stephen's Green, Dublin 2, Ireland, telephone no: +353-1-6162000. =
Directors: D O'Connor (Chairman), F Daly, A Dukes, M Keane, D Quilligan.
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2 Ireland
Registered in Ireland: No 22045
Anglo Irish Bank Corporation Limited is regulated by the Financial Regulato=
r. Anglo Irish Bank Corporation Limited (trading as Anglo Irish Bank Privat=
e Banking) is regulated by the Financial Regulator. Anglo Irish Assurance C=
ompany Limited is regulated by the Financial Regulator. =
************************************************************ **********
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: PERL Pattern matching
am 07.04.2009 17:24:58 von Justin Allegakoen
2009/4/7 Conor Lillis :
>
> -----Original Message-----
> From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-boun=
ces@listserv.ActiveState.com] On Behalf Of Justin Allegakoen
> Sent: 07 April 2009 13:54
> To: ActivePerl@listserv.ActiveState.com
> Subject: Re: PERL Pattern matching
>
> 2009/4/7 Conor Lillis :
>> Hi all,
>> I have a requirement to match a file against a number of possible
>> strings.
>> I also need to retain the successfully matching elements, and based on
>> the match from the primary list, see if a corresponding secondary
>> match is also in the file.
>>
>> E.g.. Picture the list below
>>
>> A =A0 =A0 =A0 B
>> ---------
>> 1 =A0 =A0 =A0 a
>> 2 =A0 =A0 =A0 b
>> 3 =A0 =A0 =A0 c
>> 4 =A0 =A0 =A0 d
>> 5 =A0 =A0 =A0 e
>> 6 =A0 =A0 =A0 f
>>
>> I need to match any of the first column in the file, and for any
>> matches in the first row match the corresponding entry for the second co=
lumn.
>> So if I match 3 and 5 in the file, I rescan and see if I can match c
>> or e in the same file.
>>
>> Here is a snippet of how I am matching anything from column A, and
>> then rescanning for only corresponding entries from column B.
>> Is there a more efficient method than what I am doing here?
>>
>> while()
>> {
>> =A0 =A0 =A0 =A0foreach my $string (@strings)
>> =A0 =A0 =A0 =A0{
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (grep /$string/i, $_)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0$primary =3D++$primary;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!grep /$string/i,
>> @matchindex){push(@matchindex, "$string");}
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0print gmtime()."\"$file\"=
matched on primary -
>> $string\n";
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>> =A0 =A0 =A0 =A0}
>> }
>> close(FILE);
>> if (@matchindex)
>> {
>> # =A0 =A0 =A0 GetSecondaries() Reads array to get 2nd column entries for
>> primary matches by splitting row on seperators
>> =A0 =A0 =A0 =A0my @matches =3D GetSecondaries(@matchindex);
>> =A0 =A0 =A0 =A0open(FILE, $file);
>> =A0 =A0 =A0 =A0LOOP: while()
>> =A0 =A0 =A0 =A0{
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0foreach my $string (@matches)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (grep /$string/i, $_)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0$secondar=
ycounter =3D
>> ++$secondarycounter;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0print gmt=
ime()."********\t: Also
>> matched on secondary - $string\n";
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0logger("$=
string,$file"); =A0 =A0 =A0 =A0# Logs
>> output to a log file
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0last LOOP;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>> }
>> close(FILE);
>
> I doubt your data is as simplistic as you describe which is why I miss th=
e point of 'rescanning' the data for a 2nd time after the first match. Base=
d on your example is there a possibility that say 3 from column A could rel=
ate to anything other than 'c'?
>
> Looking at your sample the i modifier in the grep in the foreach is a pri=
me candidate for hashes and the exists function. Have a look at perldsc whi=
ch may give you some ideas of how your data structure should really appear.
>
> If that doesn't help and the others on the list can't see what you're aft=
er then sanitise some of the real data (I'm sure its confidential looking a=
t your e-mail address ; ) and re-describe the end desired result - which mo=
st probably involves account numbers and the amount of times they have used=
their debit facility : p
>
> Just in
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
> Justin
> Thanks for the response. I am scanning randomly formatted text files to s=
ee if any of the elements in column A appear. For those that do appear, I a=
m rescanning the file for the corresponding values in column B. In some cas=
es there are multiple matches in column B for a value in column A, but I ma=
nage that using the function GetSecondaries() that is not included, but thi=
s element is working fine (accurately and quickly) from debugging it previo=
usly.
>
> The reason for the rescan is that using the while() read statement =
I am already at the end of the file when I know how many matches for column=
A I have, and for all matches I have to rescan the file for the related va=
lues in column B. I need to know all matches for col. A before I can rescan=
for column B matches.
>
> Part of the issue may be that I have 130 "pairs" of data to scan for. How=
ever the analysis on a 2 MB file is taking 70 seconds, just on column A val=
ues, so that suggests grepping against the $_ variable while reading the fi=
le is not economic. My server is a new Win2003 file server with 3GB RAM and=
4 CPU so hardware performance should really not be a bottleneck. Perl seem=
s to sit on one CPU looking at task manager, the CPU usage doesn't exceed 2=
5% (RAM utilisation is also very little).
>
> What I guess I am really hoping for is a more economic method to read the=
file and match any of the 130 primary elements of the array against the fi=
le, but retain the matching values for re-use in the 2nd loop.
> Perhaps grep is not the most appropriate mechanism to use for this type o=
f retrieval?
>
> It is an unusual request I agree. What I can do is generate a test data f=
ile and upload the whole script & data file for completeness if this is any=
use in clarifying what I am trying to achieve..
>
> Conor
Ok. Have you considered Tie::File? You could use a data structure
where column A is your key and the value is composed of the count of
column A, a corresponding value (or a list of values) for column B,
and a list (if necessary) of all line numbers (well array indices for
Tie::File) where column A occurs.
2MB is trivial for that amount of hardware and even though I'm still
confused by your code I'd say that the foreach grep ignore case
negated grep ignore case would be far better off being replaced by a
hash and an exists call.
Just in
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: PERL Pattern matching
am 07.04.2009 18:38:19 von Brian Raven
Conor Lillis <> wrote:
> Hi all,
> I have a requirement to match a file against a number of possible
> strings.
> I also need to retain the successfully matching elements, and based
> on the match from the primary list, see if a corresponding secondary
> match is also in the file.
>
> E.g.. Picture the list below
>
> A B
> ---------
> 1 a
> 2 b
> 3 c
> 4 d
> 5 e
> 6 f
>
> I need to match any of the first column in the file, and for any
> matches in the first row match the corresponding entry for the second
> column.
> So if I match 3 and 5 in the file, I rescan and see if I can match c
> or e in the same file.
>
> Here is a snippet of how I am matching anything from column A, and
> then rescanning for only corresponding entries from column B.
> Is there a more efficient method than what I am doing here?
Probably, but if it works, and is fast enough, why bother.
So, assuming that it isn't fast enough (not sure if it works, as I am
not sure if I understand what you are trying to do), here is where I get
to pick holes in your code. (:-) in cast it isn't obvious).
First, I realise that this is just a code fragment, but you do have "use
strict; use warnings;" at the start, don't you? If not consider this the
first comment. Note that Outlook has decided to wrap some of your lines.
>
> while()
> {
> foreach my $string (@strings)
> {
> if (grep /$string/i, $_)
grep is wasted here. "if (/$string/i)" is more Perl-ish. Also it would
probably be more efficient to perform a single match for the whole set
of strings, than multiple matches for each one. See below.
> {
> $primary =++$primary;
Weird! What's wrong with just "++$primary;". That's the equivalent of
saying "$primary += 1; $primary = $primary".
> if (!grep /$string/i,
> @matchindex){push(@matchindex, "$string");}
That's more appropriate use of grep, but your quoting of $string is
unnecessary. Useless quoting is generally frowned upon.
> print gmtime()."\"$file\" matched on primary -
$string\n";
> }
> }
> }
> close(FILE);
No need to close the file here.
> if (@matchindex)
> {
> # GetSecondaries() Reads array to get 2nd column entries for
> primary matches by splitting row on seperators
> my @matches = GetSecondaries(@matchindex);
> open(FILE, $file);
You could just seek back to the beginning of the file rather than open
the file again. Also, you should always check that the open call was
successful.
> LOOP: while()
> {
> foreach my $string (@matches)
> {
> if (grep /$string/i, $_)
> {
> $secondarycounter = ++$secondarycounter;
As above.
> print gmtime()."********\t: Also matched
on secondary -
> $string\n"; logger("$string,$file");
#
> Logs output to a log file
> last LOOP;
Are you sure about that? You exit from the loop after the very first
secondary match. What about the others?
> }
> }
> }
> close(FILE);
If my guess about what you are trying to do is right, the following
might be a bit more efficient.
-------------------------------------------------------
use strict;
use warnings;
use Fcntl qw{:seek};
my %match_table = (1 => "a",
2 => "b",
3 => "c",
4 => "d",
5 => "e",
6 => "f");
my $fn = shift;
die "Expecting filename\n" unless $fn;
open my $fd, "<", $fn or die "Failed to open $fn: $!\n";
my @primaries = find_matches($fd, sort keys %match_table);
@primaries > 0 or die "No primaries found in $fn\n";
print "Found primaries: @primaries\n";
seek $fd, 0, SEEK_SET or die "Failed to seek: $!\n";
$. = undef;
my @secondaries = find_matches($fd, sort @match_table{@primaries});
@secondaries > 0 or die "No secondaries found\n";
print "Found secondaries: @secondaries\n";
close $fd;
sub find_matches {
my $fd = shift;
my @strings = @_;
my @matches;
return () unless @strings > 0;
my $matchRE = makeRE(@strings);
print "Start looking at line $.\n";
while (<$fd>) {
if (/($matchRE)/i) {
my $match_str = $1;
push @matches, $match_str;
@strings = grep {$_ ne $match_str} @strings;
$matchRE = makeRE(@strings);
# No point continuing if nothing left to look for
last unless $matchRE;
}
}
print "Stopped looking at line $.\n";
return @matches;
}
# Make regexp to match a list of words.
sub makeRE {
return undef unless @_ > 0;
my $str = join "|", map {"(?:$_)"} @_;
return qr{$str};
}
-------------------------------------------------------
You may be able to do better with a single pass through the file,
depending upon the size of your file and the table of strings you are
looking for.
HTH
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 18:50:47 von Bryan Keller
Let's put this issue to rest. As Bill Luebkert said in a previous response, "awful" was being used as an intensifier.
An adverb which is used to modify adjectives and adverbs, but which is not usually used to modify verbs, can be referred to as an intensifier. In the following examples, the intensifiers are surrounded by *s.
e.g.,
I am *very* happy.
The film was *quite* good.
You did that *rather* well.
Must you leave *so* soon?
Jan did an *awful* lot of work.
The *intensifiers* carry little or no meaning by themselves in these sentences. Their purpose is to INTENSIFY or accentuate, or highlight, the adjective or adverb they are attached to.
One might say "This pen writes *awfully* well." This would mean that the pen writes *very* well. It does NOT mean that the pen writes awfully because, when used as an intensifier, the word carries no meaning.
The following words are commonly used as intensifiers:
awful
damn
fairly
quite
rather
really (informal)
so
too
very
-------------
Bryan Keller, Doctoral Student/Project Assistant
Educational Psychology - Quantitative Methods
The University of Wisconsin - Madison
----- Original Message -----
From: Deane.Rothenmaier@walgreens.com
Date: Tuesday, April 7, 2009 8:07 am
Subject: Re: Perl6 though IIS7 CGI
To: Francisco Zarabozo
Cc: activeperl-bounces@listserv.ActiveState.com, "ActivePerl@listserv.ActiveState.com"
> Francisco,
>
> My guess is that, with his English deficiency, he substituted awful
> for
> awesome, thinking they had synonymous denotations. Or, mayhap he read
>
> "awful" as being "awe-ful," meaning the same as awesome.....
>
> My $0.02.
>
> Deane Rothenmaier
> Programmer/Analyst
> Walgreens Corp.
> 224-542-5150
>
> Everything should be made as simple as possible...but not simpler. -
> Albert Einstein
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 19:17:51 von lyle
Bryan Keller wrote:
> Let's put this issue to rest. As Bill Luebkert said in a previous response, "awful" was being used as an intensifier
Ok. Now that's sorted. Can we get back onto the subject matter? :)
http://forums.iis.net/p/1156635/1899524.aspx#1899524
Lyle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 07.04.2009 22:04:29 von lyle
Just tested on WinXP. Works on Apache, just hangs on IIS 5.1... :(
Lyle wrote:
> Bryan Keller wrote:
>
>> Let's put this issue to rest. As Bill Luebkert said in a previous response, "awful" was being used as an intensifier
>>
>
> Ok. Now that's sorted. Can we get back onto the subject matter? :)
> http://forums.iis.net/p/1156635/1899524.aspx#1899524
>
>
> Lyle
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl6 though IIS7 CGI
am 08.04.2009 11:30:29 von Brian Raven
Lyle <> wrote:
> Just tested on WinXP. Works on Apache, just hangs on IIS 5.1... :(
>
>
> Lyle wrote:
>> Bryan Keller wrote:
>>
>>> Let's put this issue to rest. As Bill Luebkert said in a previous
>>> response, "awful" was being used as an intensifier
>>>
>>
>> Ok. Now that's sorted. Can we get back onto the subject matter? :)
>> http://forums.iis.net/p/1156635/1899524.aspx#1899524
I don't know IIS from a hole in the ground, so just to check. I suspect
that IIS might not honour the '#!' *nix magic as, I believe, Apache
does, so have you configured it to run the appropriate Perl executable?
HTH
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: PERL Pattern matching
am 08.04.2009 16:22:39 von Conor Lillis
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Brian
Raven
Sent: 07 April 2009 17:38
To: ActivePerl@listserv.ActiveState.com
Subject: RE: PERL Pattern matching
Conor Lillis <> wrote:
> Hi all,
> I have a requirement to match a file against a number of possible
> strings.
> I also need to retain the successfully matching elements, and based on
> the match from the primary list, see if a corresponding secondary
> match is also in the file.
>
> E.g.. Picture the list below
>
> A B
> ---------
> 1 a
> 2 b
> 3 c
> 4 d
> 5 e
> 6 f
>
> I need to match any of the first column in the file, and for any
> matches in the first row match the corresponding entry for the second
> column.
> So if I match 3 and 5 in the file, I rescan and see if I can match c
> or e in the same file.
>
> Here is a snippet of how I am matching anything from column A, and
> then rescanning for only corresponding entries from column B.
> Is there a more efficient method than what I am doing here?
Probably, but if it works, and is fast enough, why bother.
So, assuming that it isn't fast enough (not sure if it works, as I am
not sure if I understand what you are trying to do), here is where I get
to pick holes in your code. (:-) in cast it isn't obvious).
First, I realise that this is just a code fragment, but you do have "use
strict; use warnings;" at the start, don't you? If not consider this the
first comment. Note that Outlook has decided to wrap some of your lines.
>
> while()
> {
> foreach my $string (@strings)
> {
> if (grep /$string/i, $_)
grep is wasted here. "if (/$string/i)" is more Perl-ish. Also it would
probably be more efficient to perform a single match for the whole set
of strings, than multiple matches for each one. See below.
> {
> $primary =++$primary;
Weird! What's wrong with just "++$primary;". That's the equivalent of
saying "$primary += 1; $primary = $primary".
> if (!grep /$string/i,
> @matchindex){push(@matchindex, "$string");}
That's more appropriate use of grep, but your quoting of $string is
unnecessary. Useless quoting is generally frowned upon.
> print gmtime()."\"$file\" matched on primary -
$string\n";
> }
> }
> }
> close(FILE);
No need to close the file here.
> if (@matchindex)
> {
> # GetSecondaries() Reads array to get 2nd column entries for
> primary matches by splitting row on seperators
> my @matches = GetSecondaries(@matchindex);
> open(FILE, $file);
You could just seek back to the beginning of the file rather than open
the file again. Also, you should always check that the open call was
successful.
> LOOP: while()
> {
> foreach my $string (@matches)
> {
> if (grep /$string/i, $_)
> {
> $secondarycounter = ++$secondarycounter;
As above.
> print gmtime()."********\t: Also matched
on secondary -
> $string\n"; logger("$string,$file");
#
> Logs output to a log file
> last LOOP;
Are you sure about that? You exit from the loop after the very first
secondary match. What about the others?
> }
> }
> }
> close(FILE);
If my guess about what you are trying to do is right, the following
might be a bit more efficient.
-------------------------------------------------------
use strict;
use warnings;
use Fcntl qw{:seek};
my %match_table = (1 => "a",
2 => "b",
3 => "c",
4 => "d",
5 => "e",
6 => "f");
my $fn = shift;
die "Expecting filename\n" unless $fn;
open my $fd, "<", $fn or die "Failed to open $fn: $!\n";
my @primaries = find_matches($fd, sort keys %match_table); @primaries >
0 or die "No primaries found in $fn\n"; print "Found primaries:
@primaries\n";
seek $fd, 0, SEEK_SET or die "Failed to seek: $!\n"; $. = undef;
my @secondaries = find_matches($fd, sort @match_table{@primaries});
@secondaries > 0 or die "No secondaries found\n"; print "Found
secondaries: @secondaries\n";
close $fd;
sub find_matches {
my $fd = shift;
my @strings = @_;
my @matches;
return () unless @strings > 0;
my $matchRE = makeRE(@strings);
print "Start looking at line $.\n";
while (<$fd>) {
if (/($matchRE)/i) {
my $match_str = $1;
push @matches, $match_str;
@strings = grep {$_ ne $match_str} @strings;
$matchRE = makeRE(@strings);
# No point continuing if nothing left to look for
last unless $matchRE;
}
}
print "Stopped looking at line $.\n";
return @matches;
}
# Make regexp to match a list of words.
sub makeRE {
return undef unless @_ > 0;
my $str = join "|", map {"(?:$_)"} @_;
return qr{$str};
}
-------------------------------------------------------
You may be able to do better with a single pass through the file,
depending upon the size of your file and the table of strings you are
looking for.
HTH
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient or have received this e-mail in
error, please advise the sender immediately by reply e-mail and delete
this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in
this e-mail is strictly forbidden.
_______________________________________________
Brian
Thanks for that, your makeRE function had great benefit performance
wise, but your other pointers are also appreciated, aswell as the time
you took to write the script at the bottom.
I got the scan on a sample file from 80 seconds down to 5 using this and
other tuning you suggested. I have 140 strings in column A, aswell as
multiple possible match strings in column B per row, which is why I
couldn't use a hash.
My input file is more like :-
Column A Column B
--------------------
[White] [dog]
[Black] [cat]
[Grey] [fox,cow] (match on grey and either fox or cow)
Thanks also to Justin and Martin for responding, all have provided
useful tips!
Regards,
Conor Lillis
---------------------------------------
Senior Systems Administrator,
Group Network Services,
tel : +353-1-616-2540
Anglo Irish Bank
www.angloirishbank.ie
---------------------------------------
************************************************************ **********
Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. If you have received this e-mail or any file or attachment transmitted with it in error please notify Anglo Irish Bank Corporation Limited, Stephen Court, 18/21 St Stephen's Green, Dublin 2, Ireland, telephone no
: +353-1-6162000.
Directors: D O'Connor (Chairman), F Daly, A Dukes, M Keane, D Quilligan.
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2 Ireland
Registered in Ireland: No 22045
Anglo Irish Bank Corporation Limited is regulated by the Financial Regulator. Anglo Irish Bank Corporation Limited (trading as Anglo Irish Bank Private Banking) is regulated by the Financial Regulator. Anglo Irish Assurance Company Limited is regulated by the Financial Regulator.
************************************************************ **********
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 08.04.2009 22:02:59 von Bill Luebkert
Brian Raven wrote:
> Lyle <> wrote:
>> Just tested on WinXP. Works on Apache, just hangs on IIS 5.1... :(
>>
>>
>> Lyle wrote:
>>> Bryan Keller wrote:
>>>
>>>> Let's put this issue to rest. As Bill Luebkert said in a previous
>>>> response, "awful" was being used as an intensifier
>>>>
>>> Ok. Now that's sorted. Can we get back onto the subject matter? :)
>>> http://forums.iis.net/p/1156635/1899524.aspx#1899524
>
> I don't know IIS from a hole in the ground, so just to check. I suspect
> that IIS might not honour the '#!' *nix magic as, I believe, Apache
> does, so have you configured it to run the appropriate Perl executable?
I don't think the shebang line is pertinent. You do have to associate
..pl files with CGI somehow in IIS (never used it) I believe. I think
IIS requires the status header ("HTTP/1.0 200 OK\n") prior to the
content-type. Not sure if that's the issue though.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl6 though IIS7 CGI
am 08.04.2009 22:31:38 von Doug Loud
For what it's worth, these comments from Bill Cole have saved me repeatedly
over the years (since Oct 31, 2003), when dealing with Windows, IIS and CGI.
Hope they help you too.
Doug Loud
Oct 31, 2003 Comments
Dave,
I don't know if you are running it from the command line or in the browser.
Here are a few things to check:
*Make sure that IIS is running :Control Panel>Add/Remove programs>Add/Remove
Windows Components>Indexing Service>Internet Information Services(IIS)
options
*Make sure that you have permissions to run scripts in the given
folder:Right click folder>Properties>Web Sharing/Share this folder>check
Read, Script Source Access and check Scripts application button.
*File extension associations:C:>Tools>Folder Options>File Types>New>Type
CGI>Advanced>Associate with Perl File>OK
*Associate Perl extensions w/perl interpreter to run scripts in browser:
Choose Administrative Tools from Control panel>Computer Management>Services
and Applications>Internet Information Services>Expand Default Web Site
folder>Right click cgi-bin, click Properties>Click Virtual Directory tab if
necessary and click the Configuration ... button. Scroll until you see the
..pl extension info, click the Edit button and swlect the Script Engine
option. Also deselect the Check that file exists option, if necessary.
Click OK. Click the Add button. In the Executable box, type
C:\Perl\bin\perl.exe "%s" %s. In the extension box type.cgi. Select the
Limit to button, then type GET, HEAD, POST. If necessary selectScript
Engine option. Click OK.Click OK.Click OK.
I know this is kind of lengthy, but it is a checklist I went through just a
few days ago.
Regards,
Bill Cole
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Bill
Luebkert
Sent: Wednesday, April 08, 2009 4:03 PM
To: Lyle
Cc: ActivePerl@listserv.ActiveState.com
Subject: Re: Perl6 though IIS7 CGI
Brian Raven wrote:
> Lyle <> wrote:
>> Just tested on WinXP. Works on Apache, just hangs on IIS 5.1... :(
>>
>>
>> Lyle wrote:
>>> Bryan Keller wrote:
>>>
>>>> Let's put this issue to rest. As Bill Luebkert said in a previous
>>>> response, "awful" was being used as an intensifier
>>>>
>>> Ok. Now that's sorted. Can we get back onto the subject matter? :)
>>> http://forums.iis.net/p/1156635/1899524.aspx#1899524
>
> I don't know IIS from a hole in the ground, so just to check. I
> suspect that IIS might not honour the '#!' *nix magic as, I believe,
> Apache does, so have you configured it to run the appropriate Perl
executable?
I don't think the shebang line is pertinent. You do have to associate .pl
files with CGI somehow in IIS (never used it) I believe. I think IIS
requires the status header ("HTTP/1.0 200 OK\n") prior to the content-type.
Not sure if that's the issue though.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 08.04.2009 22:51:21 von lyle
Update: This is a parrot/IIS issue.
Brian Raven wrote:
> Lyle <> wrote:
>
>> Just tested on WinXP. Works on Apache, just hangs on IIS 5.1... :(
>>
>>
>> Lyle wrote:
>>
>>> Bryan Keller wrote:
>>>
>>>
>>>> Let's put this issue to rest. As Bill Luebkert said in a previous
>>>> response, "awful" was being used as an intensifier
>>>>
>>>>
>>> Ok. Now that's sorted. Can we get back onto the subject matter? :)
>>> http://forums.iis.net/p/1156635/1899524.aspx#1899524
>>>
>
> I don't know IIS from a hole in the ground, so just to check. I suspect
> that IIS might not honour the '#!' *nix magic as, I believe, Apache
> does, so have you configured it to run the appropriate Perl executable?
>
Yes I've set the correct script mapping. The script is actually running,
IIS just isn't getting the output.
Lyle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Install Truly Random from CPAN when not listed in the ppm search
am 09.04.2009 00:30:15 von David.Fish
Hello! I am trying to install the Math::TrulyRandom
(http://search.cpan.org/~gary/Math-TrulyRandom-1.0/TrulyRand om.pod)
using ppm but it is not located in the search option to install. How
would I install this so my local perl recognizes this new perl program?
I do have the .gz file from the website above. I am using perl 5.8 on
Windows XP.
Thanks,
David Fish
Senior Systems Analyst
Property Systems Services
Work (301) 380-3331
Fax (301) 644-7521
BlackBerry (301) 646-8985
david.fish@marriott.com
This communication contains information from Marriott International,
Inc. that may be confidential. Except for personal use by the intended
recipient, or as expressly authorized by the sender, any person who
receives this information is prohibited from disclosing, copying,
distributing, and/or using it. If you have received this communication
in error, please immediately delete it and all copies, and promptly
notify the sender. Nothing in this communication is intended to operate
as an electronic signature under applicable law.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl6 though IIS7 CGI
am 09.04.2009 02:19:49 von lyle
Hi,
I've worked with the parrot people and we've (mostly they) found and
fixed the problem.
When calling a CGI script without any POST data IIS doesn't allow STDIN
to be opened. Parrot was trying to open STDIN then crashing before it
got anywhere near opening and printing to STDOUT. This has now be
remedied and should be fixed in future versions of parrot.
Now I can finally get on with my Perl 6 CGI scripting guides ;)
Thanks everyone for your suggestions and input.
Lyle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Install Truly Random from CPAN when not listed in the ppm search
am 09.04.2009 02:32:20 von Bill Luebkert
Fish, David wrote:
> Hello! I am trying to install the Math::TrulyRandom
> (http://search.cpan.org/~gary/Math-TrulyRandom-1.0/TrulyRand om.pod)
> using ppm but it is not located in the search option to install. How
> would I install this so my local perl recognizes this new perl program?
> I do have the .gz file from the website above. I am using perl 5.8 on
> Windows XP.
It's an XS module, so you would need to compile it yourself (which might mean
compiling Perl and everything else too unless you use a compatible compiler).
Alternatively, you could ask Randy if he has time to add it to his PPM repos:
randy@theoryx5.uwinnipeg.ca
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Install Truly Random from CPAN when not listed in the ppm search
am 09.04.2009 03:50:05 von lyle
Bill Luebkert wrote:
> Fish, David wrote:
>
>> Hello! I am trying to install the Math::TrulyRandom
>> (http://search.cpan.org/~gary/Math-TrulyRandom-1.0/TrulyRand om.pod)
>> using ppm but it is not located in the search option to install. How
>> would I install this so my local perl recognizes this new perl program?
>> I do have the .gz file from the website above. I am using perl 5.8 on
>> Windows XP.
>>
>
> It's an XS module, so you would need to compile it yourself (which might mean
> compiling Perl and everything else too unless you use a compatible compiler).
> Alternatively, you could ask Randy if he has time to add it to his PPM repos:
> randy@theoryx5.uwinnipeg.ca
>
MinGW is usually compatible:-
http://www.mingw.org/
Lyle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Install Truly Random from CPAN when not listed in the ppm search
am 09.04.2009 06:21:57 von Gaurav Vaidya
Hi David,
2009/4/9 Bill Luebkert :
> Fish, David wrote:
>> Hello! =A0I am trying to install the Math::TrulyRandom
>> (http://search.cpan.org/~gary/Math-TrulyRandom-1.0/TrulyRand om.pod)
> It's an XS module, so you would need to compile it yourself (which might =
mean
> compiling Perl and everything else too unless you use a compatible compil=
er).
> Alternatively, you could ask Randy if he has time to add it to his PPM re=
pos:
> randy@theoryx5.uwinnipeg.ca
.... or try compiling it yourself using Strawberry Perl [1]. You might
be able to get it to work by installing it with Strawberry's "cpan",
since it comes with its own C compiler and build tools.
That might not be enough, though; according to CPAN Testers
reports[2], Math-TrulyRandom has problems being installed on multiple
platforms. Maybe you could look for another modules which has been
better tested?
cheers,
Gaurav
[1] http://strawberryperl.com/
[2] http://matrix.cpantesters.org/?dist=3DMath-TrulyRandom+1.0
You can get to the CPAN Testers from search.cpan.org by clicking on
"Perl/Platform Version Matrix" link on [3].
[3] http://search.cpan.org/~gary/Math-TrulyRandom-1.0/
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs