[17129] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4541 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 6 18:05:30 2000

Date: Fri, 6 Oct 2000 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)
Message-Id: <970869912-v9-i4541@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 6 Oct 2000     Volume: 9 Number: 4541

Today's topics:
        1000 times slower? <jrw32982@my-deja.com>
    Re: 1000 times slower? nobull@mail.com
    Re: 1000 times slower? <jrw32982@my-deja.com>
    Re: Autologin script hurricane_number_one@my-deja.com
    Re: beginner question <lr@hpl.hp.com>
    Re: Code example in Cookbook aramis1250@my-deja.com
    Re: DBM files don't work after upgrade (Andy Dougherty)
    Re: Does a DCOM client module exist? <dougd@shieldsbag.com>
    Re: factorial function problem <bhoylma@uswest.com>
    Re: factorial function problem <lr@hpl.hp.com>
    Re: factorial function problem <tony_curtis32@yahoo.com>
    Re: Formating output to be read in a form. <anmcguire@ce.mediaone.net>
        How to issue NT 'AT" Command from perl? princekr@acwilm.com
        Matching a string containing a space between letters <easyeieio@nospam.yahoo.co.uk>
    Re: Matching a string containing a space between letter <srame@excite.no.spam.no.com>
    Re: Matching a string containing a space between letter <james@NOSPAM.demon.co.uk>
    Re: Matching a string containing a space between letter <easyeieio@nospam.yahoo.co.uk>
    Re: mod_perl and ActiveState perl (v5.6.0 618) <randy@theoryx5.uwinnipeg.ca>
    Re: Not Entirely On Topic:  Programming and math <uri@sysarch.com>
        perl locating file under a web application <maxime.fruit@libertysurf.fr>
    Re: perl locating file under a web application <jeff@vpservices.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 06 Oct 2000 19:06:23 GMT
From: John Wiersba <jrw32982@my-deja.com>
Subject: 1000 times slower?
Message-Id: <8rl7rd$mp3$1@nnrp1.deja.com>

Can anyone explain why the VAR_SUB benchmark is so much slower than
VAR_INLINE?  The input file was a 58K 1756-line file.  Is VAR_SUB
recompiling the regexp each time?  Why?  Or maybe my code is buggy in
some other way?

-- John Wiersba

Benchmark: running VAR_INLINE, VAR_SUB, each for at least 5 CPU
seconds...
VAR_INLINE:  5 wallclock secs ( 5.09 usr +  0.00 sys =  5.09 CPU) @
   289933.99/s (n=1475764)
VAR_SUB:  5 wallclock secs ( 5.34 usr +  0.00 sys =  5.34 CPU) @
   169.29/s (n=904)


 #!/usr/local/bin/perl -ws

 use strict;
 use diagnostics;
 use Benchmark;

 my @lines = <>;

 my $idPat = qr/[a-zA-Z_:][\w:.-]*/o;
 sub var_sub {
   for (@lines) {
       /^\s*$idPat\s*=\s*/o;
   }
 }
 timethese -5, {
   VAR_INLINE => '
       for (@lines) {
         /^\s*$idPat\s*=\s*/o;
       }
   ',
   VAR_SUB => 'var_sub()',
 };



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 06 Oct 2000 20:44:37 +0100
From: nobull@mail.com
Subject: Re: 1000 times slower?
Message-Id: <u9aechdaai.fsf@wcl-l.bham.ac.uk>

John Wiersba <jrw32982@my-deja.com> writes:

> Can anyone explain why the VAR_SUB benchmark is so much slower than
> VAR_INLINE?

Yes.

>  my @lines = <>;
> 
>  my $idPat = qr/[a-zA-Z_:][\w:.-]*/o;
>  sub var_sub {
>    for (@lines) {
>        /^\s*$idPat\s*=\s*/o;
>    }
>  }
>  timethese -5, {
>    VAR_INLINE => '
>        for (@lines) {
>          /^\s*$idPat\s*=\s*/o;
>        }
>    ',
>    VAR_SUB => 'var_sub()',
>  };

@lines and $idPat are a lexical variables in your script.  As such
when Benchmark.pm eval()s the string you give it in VAR_INLINE these
variables are undefined.  Use strict is lexically scoped so won't pick
up this error.  I don't know why the -w didn't pick it up.

Make these variable globals and then look at the outcome.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 06 Oct 2000 20:23:10 GMT
From: John Wiersba <jrw32982@my-deja.com>
Subject: Re: 1000 times slower?
Message-Id: <8rlcb8$qa2$1@nnrp1.deja.com>

nobull@mail.com wrote:
> @lines and $idPat are a lexical variables in your script.  As such
> when Benchmark.pm eval()s the string you give it in VAR_INLINE these
> variables are undefined.  Use strict is lexically scoped so won't pick
> up this error.  I don't know why the -w didn't pick it up.

Thanks!  I had just figured this out for myself, too (I knew there had
to be a reason!).  Is there a way to make "use strict" apply to the code
being benchmarked, too?

-- John Wiersba


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 06 Oct 2000 18:41:07 GMT
From: hurricane_number_one@my-deja.com
Subject: Re: Autologin script
Message-Id: <8rl6c4$lln$1@nnrp1.deja.com>

Is there a simplier way to do it through Perl without having to use
Expect? I don't want to make everyone who I give this scipt to have to
install Expect and Tcl.
Is there a simpler way?
Thanks.

In article <8rku9p$fvf$1@nnrp1.deja.com>,
  [ jargoone ] <jargoone@hotmail.com> wrote:
> In article <8rkt3j$esl$1@nnrp1.deja.com>,
>   hurricane_number_one@my-deja.com wrote:
> > How do I make my perl script send my password to this prompt?
>
> this is a stupid idea.  nevertheless, there are tools that help you do
> stupid things.
>
> check out http://expect.nist.gov/.
>
> --
> --jgn
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 6 Oct 2000 11:36:47 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: beginner question
Message-Id: <MPG.1447bb9552bf86298ae15@nntp.hpl.hp.com>

In article <39dee6ee.57929051@news.newsguy.com> on Fri, 06 Oct 2000 
14:56:35 GMT, Keith Calvert Ivey <kcivey@cpcug.org> says...
> Larry Rosler <lr@hpl.hp.com> wrote:
> >In article <39dd0bf4.1863033@news.newsguy.com>, kcivey@cpcug.org says...
> >> Larry Rosler <lr@hpl.hp.com> wrote:
> >> 
> >> >qw(Sun Mon Tue Wed Thu Fri Sat)[...]
> >> >                       Use the numerical day of the week to extract
> >> >                       the name from a list of names.  I have corrected
> >> >                       the expression so it doesn't use barewords,
> >> >                       which would draw a warning.
> >> 
> >> I think you need another set of parentheses there.
> >
> >I thought so also, until I tested the code without them, and it worked 
> >fine.  So I saved two keystrokes, at the cost of this subthread.  :-)
> 
> I tested too, of course, but not in 5.6.  I apologize for the
> subthread.  I still think that at this stage 5.6-only code
> should be indicated as such in newsgroup discussions.

I didn't realize I had run across a delta in 5.6, just a misremembering 
that one had to enclose qw() in parentheses in order to index into the 
list.  So this has proven to be a useful subthread after all, and no 
apologies are warranted.

Here, to save anyone the trouble of looking it up, is the excerpt from 
perldelta.  Note that the issue of the extra binding parentheses is not 
discussed explicitly, but might possibly be inferred.  It would have 
been better to be explicit, IMO.


Improved qw// operator

The qw// operator is now evaluated at compile time into a true list 
instead of being replaced with a run time call to split(). This removes 
the confusing misbehaviour of qw// in scalar context, which had 
inherited that behaviour from split().

Thus:

    $foo = ($bar) = qw(a b c); print "$foo|$bar\n";

now correctly prints ``3|a'', instead of ``2|a''.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 06 Oct 2000 19:25:53 GMT
From: aramis1250@my-deja.com
Subject: Re: Code example in Cookbook
Message-Id: <8rl8vt$njt$1@nnrp1.deja.com>

In article <CUPC5.18$bP3.3345@vic.nntp.telstra.net>,
  "Wyzelli" <wyzelli@yahoo.com> wrote:
> <aramis1250@my-deja.com> wrote in message
> news:8rg3de$i4c$1@nnrp1.deja.com...
> > I've been reading through the Perl Cookbook, and came
across
> > the following snippit to extract information from apache
common
> > logs:
> > # BEGIN code snippit
> > while <LOGFILE> {
> >  my ($client, $identuser, $authuser, $date, $time, $tz, $method,
> > $url, $protocol, $status, $bytes) = /^(\S+) (\S+) (\S+)
> > \[([^:]+):(\d+:\d+:\d) ([^\]]+) "(\S+) (.8?) (\S+)" (\S+) (\S+)$/
> > # my code here
> > } # END while logfile
> > # END code snippit
> >
> > The problem that I run into is that .... none of the variables in
the
> > first part ever get anything. What did I miss?
> >
>
> Opening the log file?

No, the log file opens fine. Code in the "my code" section (not
printed because it works) prints $_ for each line, and I can see the
logfile's contents in the console window. The problem seems to
be that the regexp in the assignment isn't actually matching
anything, and so each variable doesn't get assigned.

This is the entire listing.

#!/usr/bin/perl -T
my $searchString = "jobs\.html";

use Time::localtime;

my %hits = ();
my $totalHits = 0;

my ($today, $month, $nowH, $nowM);

$tm = localtime;

($today, $month, $nowH, $nowM) = ($tm->mday, $tm->mon,
$tm->hour, $tm->min);

$month++;

$outputfile =
"/Server_HD1/docs/\~hrweb/hit_stats.$today.$month.$nowH.$now
M";

open (OUTFILE, ">>$outputFile") or die "Can't open $outputFile:
$!";

open (TESTFILE, ">>testFile.txt") or die "Can't open test file: $!";

$directory = "/Local/Library/WebServer/Logs";
opendir (LOGS, "$directory") or die "Can't get $directory: $!";

while (defined($theFile = readdir(LOGS))) {

  if ($theFile =~ /^apache_access.*/) {  open (LOGFILE, "$theFile") or die
"Can't open $theFile: $!";  foreach (<LOGFILE>) {  my ($client, $identuser,
$authuser, $date, $time, $tz, $method, $url, $protocol, $status, $bytes) =
/^(\S+) (\S+) (\S+) \[([^:]+):(\d+:\d+:\d+) ([^\]]+) "(\S+) (.*?) (\S+)"
(\S+) (\S+)$/;	print $_;  print TESTFILE ("this line: $client $url\n");  if
($url =~ /$searchString/) {  if ($hits{$client}) { $hits{$client}++; } else {
$hits{$client} = 1; }  $totalHits++;  } # END if url == searchstring  } # END
while LOGFILE  close LOGFILE;  } # END if apache_access } # END while def
theFile.

close TESTFILE;

foreach $client (sort keys %hits) {
    print OUTFILE ("Total # of hits from $client is $hits{$client}\n");
} # END foreach key in hits

print OUTFILE ("Total overallhits is $totalHits\n");
close OUTFILE;


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 06 Oct 2000 19:06:49 -0000
From: doughera@maxwell.phys.lafayette.edu (Andy Dougherty)
Subject: Re: DBM files don't work after upgrade
Message-Id: <slrn8ts8o3.cph.doughera@maxwell.phys.lafayette.edu>

In article <39ddaa56$1@primark.com>, Peter Howe wrote:

>> Peter Howe <peter.howe@primark.com> wrote in message
>> > I've just upgraded my Linux system and in the process, Perl has been
>> > upgraded.  I copied my whole intranet to the new machine but am finding
>> that
>> > the DBM files I have are no longer being read correctly (using the same
>> > scripts.)  [using dbmopen]

>The only difference I notice is that, although both systems are perl
>5.005_03, one is built for i386 and one for i586 - so maybe byte
>alignment/padding is defaulted differently.

The 386/586 difference is almost certainly not the problem here.  The
problem is probably in the Linux upgrade.  Specifically, dbmopen
actually calls AnyDBM_File which, in turn, calls one of (NDBM_File,
DB_File, GDBM_File, SDBM_File, or ODBM_File) (normally, that is --
it's possible to change even that list).  Which one gets called
depends on which ones Configure found when your perl binary was built.
Further, on Linux, the NDBM_File is probably implemented through the
gdbm compatibility library hooks.

When you "upgraded [your] Linux system," you probably upgraded and/or
changed the underlying libraries.  You'll need to check exactly what
did and did not get upgraded.  Some things to watch out for:  Do you
have the development versions of libgdbm installed in your new system?
Did you on the old one?  How about Berkeley db, libdb?  What version
was the old libdb?  What version is the new one?

You might try using the Unix 'file' command on your database to try to
determine exactly what kind of database you have.  Then you can
instruct perl to use the correct dbm file type (see the AnyDBM_File
man page) to open your database.

Hope this helps,

    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042


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

Date: Fri, 06 Oct 2000 14:34:13 -0700
From: Doug Dahlke <dougd@shieldsbag.com>
Subject: Re: Does a DCOM client module exist?
Message-Id: <39DE4555.5CFB84F9@shieldsbag.com>

This is great for Win32 systems, but is there a generic version of DCOM or
COM+ that will work under a Unix flavor???

Doug Dahlke
dougd@shieldsbag.com

amonotod wrote:

> In article <39CFB0ED.6391C072@genome.wi.mit.edu>,
>   Steve Rozen <steve@genome.wi.mit.edu> wrote:
> > Is any  DCOM client module available?
> > (I want to make calls to a DCOM server from perl.)
>
> http://www.activestate.com/Products/ActivePerl/docs/faq/Windows/ActivePe
> rl-Winfaq12.html
>
> HTH,
> amonotod
>
> --
>     `\|||/                     amonotod@
>       (@@)                     netscape.net
>   ooO_(_)_Ooo________________________________
>   _____|_____|_____|_____|_____|_____|_____|_____|
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

--
Doug Dahlke
I.S. Department
Shields Bag and Printing
dougd@shieldsbag.com






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

Date: Fri, 06 Oct 2000 21:30:59 GMT
From: Bruce <bhoylma@uswest.com>
Subject: Re: factorial function problem
Message-Id: <8rlgak$tlp$1@nnrp1.deja.com>

In keeping with your general format ...

#!/opt/gnu/bin/perl -w

use strict;

my $n = 0;

print "Number? ";
$n = <STDIN>;

my $ans = factorial($n);

print "ANSWER: $ans\n";

sub factorial {
  my($n) = shift;
  return(1) if ($n == 1);
  return($n * factorial($n-1));
}

 ... or something similiar.  YMMV


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 6 Oct 2000 14:40:24 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: factorial function problem
Message-Id: <MPG.1447e6a8d3dc15cf98ae19@nntp.hpl.hp.com>

In article <8rkut4$ggk$1@nnrp1.deja.com> on Fri, 06 Oct 2000 16:33:40 
GMT, iamnotananimal@my-deja.com <iamnotananimal@my-deja.com> says...
> Would someone correct this script. I'm only starting.

That's OK.  Let us help you to start out right.

> !#/usr/bin/perl

You must have typed that in, because it cannot work that way.  Next 
time, please copy-and-paste real code.

This is how you should begin your programs, to let Perl give you all the 
help it can to get it right.

  #!/usr/bin/perl -w
  use strict;

> print "Number?"; $n = <STDIN>;

Better to use one statement per line.  Because of the 'use strict;', you 
must declare the variable $n with 'my'.  Note that because of the 
(correct) use of 'my' in the subroutine, this is completely independent 
of the variables $n in each recursion on the subroutine.

 print 'Number?';
 my $n = <STDIN>;

At this point, $n has a trailing newline character, which you can chomp 
off, though its presence won't change things in this case.

You also should check that it is a positive integer, and report an error 
otherwise.

> factorial();

You need to hand the subroutine the initial value of $n as an argument.  
That is the critical error in this progam.

> sub factorial {
>         my($n) = shift;

Because you have no initial argument, the '-w' flag will warn you that 
your next use of $n will manipulate an undefined value.

>         return(1) if $n == 1;

Just in case $n came in 0 or negative, change the '==' to '<='.

>         return($n * factorial($n-1));
>                 }

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 06 Oct 2000 16:57:06 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: factorial function problem
Message-Id: <87vgv5fxal.fsf@limey.hpcc.uh.edu>

>> On Fri, 06 Oct 2000 16:33:40 GMT,
>> iamnotananimal@my-deja.com said:

> Would someone correct this script. I'm only starting.
> !#/usr/bin/perl

#!/usr/bin/perl -w
use strict;

Catch lots of silly, or other, errors.

> print "Number?"; $n = <STDIN>;

You need to chomp() $n to get rid of the newline:

chomp($n = <STDIN>);

> factorial();

you're not passing $n to the sub.

> sub factorial {
>   my($n) = shift;
>   return(1) if $n == 1;
>   return($n * factorial($n-1));
> }

You can get rid of some of the parens here, e.g.

  return 1 if $n == 1;
  return $n * factorial($n - 1);

Note also that you can improve the time performance of
factorial() by memoizing the call (at the expense of
cacheing previous results and using a bit more space).

    use Memoize;
    memoize('factorial');

q.v.

hth
t
-- 
Namaste!
And an "oogabooga" to you too!
                                         -- Homer Simpson


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

Date: Fri, 6 Oct 2000 14:15:11 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Formating output to be read in a form.
Message-Id: <Pine.LNX.4.21.0010061413180.12146-100000@hawk.ce.mediaone.net>

On Thu, 5 Oct 2000, Phil Latio quoth:

[ snip vulgarity ]

PL> >Learn to type, at your shell prompt, commands starting with perldoc
PL> 
PL> I don't have shell access.

So upgrade your OS. :-) (1/2) No, seriously, do you have access to a web
browser, the documentation is online as well.

anm
-- 
perl -wMstrict -e '
$a=[[qw[J u s t]],[qw[A n o t h e r]],[qw[P e r l]],[qw[H a c k e r]]];$.++
;$@=$#$a;$$=[reverse sort map$#$_=>@$a]->[$|];for$](--$...$$){for$}($|..$@)
{$$[$]][$}]=$a->[$}][$]]}}$,=$";$\=$/;print map defined()?$_:$,,@$_ for @$;
'



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

Date: Fri, 06 Oct 2000 18:40:56 GMT
From: princekr@acwilm.com
Subject: How to issue NT 'AT" Command from perl?
Message-Id: <8rl6bo$lll$1@nnrp1.deja.com>

I am new at this and have searched for an answer tio this question in
FAQ's and the Camel book.

Can someone show me how to issue an NT command from perl.

I am using the Active State build 522 which is perl 5.005_03

Thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 6 Oct 2000 20:13:56 +0100
From: "Easy" <easyeieio@nospam.yahoo.co.uk>
Subject: Matching a string containing a space between letters
Message-Id: <JvpD5.17053$uq5.340428@news6-win.server.ntlworld.com>

Apologies if this is easy , I am a bit of a newbie:

I am trying to create a rule , where a string is only printed if it does not
contain certain words.
Now this is okay , but the problem I have is how to test for two words next
to each other:
the code is below, what I want to do in this example is only print the
string if it does not contain 'first' , 'second' or the last'

foreach $i (@result)
{
    $i =~ s/(\r\n|\n|\r)/<br>/g;
    $i =~ s/ /&nbsp;/g;
    if (($i !~ /first/ ) && ($i !~ /second/) && ($i !~ /the last/" ))
     {
       print "$i<br>";
      }
}

Whan I use this code , it ignores the test for 'the last' and prints the
string with that in it anyway.
Am I missing something obvious? I do not know how to test for a substring
containing a space

Can anyone help please?

Many thanks
Ian




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

Date: Fri, 06 Oct 2000 13:51:03 -0600
From: srame <srame@excite.no.spam.no.com>
Subject: Re: Matching a string containing a space between letters
Message-Id: <39DE2D27.7D376DA4@excite.no.spam.no.com>


    It looks (to me) like you just substituted the space away and turned
it into a "&nbsp;"!  Also, what is that double quote doing at the end of
the last match in your if statement?

srame

Easy wrote:
> 
> Apologies if this is easy , I am a bit of a newbie:
> 
> I am trying to create a rule , where a string is only printed if it does not
> contain certain words.
> Now this is okay , but the problem I have is how to test for two words next
> to each other:
> the code is below, what I want to do in this example is only print the
> string if it does not contain 'first' , 'second' or the last'
> 
> foreach $i (@result)
> {
>     $i =~ s/(\r\n|\n|\r)/<br>/g;
>     $i =~ s/ /&nbsp;/g;
>     if (($i !~ /first/ ) && ($i !~ /second/) && ($i !~ /the last/" ))
>      {
>        print "$i<br>";
>       }
> }
> 
> Whan I use this code , it ignores the test for 'the last' and prints the
> string with that in it anyway.
> Am I missing something obvious? I do not know how to test for a substring
> containing a space
> 
> Can anyone help please?
> 
> Many thanks
> Ian


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

Date: Fri, 6 Oct 2000 20:46:02 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Matching a string containing a space between letters
Message-Id: <ant0619020b0fNdQ@oakseed.demon.co.uk>

In article <JvpD5.17053$uq5.340428@news6-win.server.ntlworld.com>, Easy wrote:
> the code is below, what I want to do in this example is only print the
> string if it does not contain 'first' , 'second' or 'the last'
> 
> foreach $i (@result)
> {
>     $i =~ s/(\r\n|\n|\r)/<br>/g;
>     $i =~ s/ /&nbsp;/g;
>     if (($i !~ /first/ ) && ($i !~ /second/) && ($i !~ /the last/" ))
>      {
>        print "$i<br>";
>       }
> }
> 
> Whan I use this code , it ignores the test for 'the last' and prints the
> string with that in it anyway. Am I missing something obvious?

Yes you are. On the previous line you convert spaces to &nbsp;
so there won't be any 'the lasts' in the string anymore.
You'll have to change that to /the&nbsp;last/

You probably saw the mistake as soon as you posted your question. :-)

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: Fri, 6 Oct 2000 20:54:27 +0100
From: "Easy" <easyeieio@nospam.yahoo.co.uk>
Subject: Re: Matching a string containing a space between letters
Message-Id: <R7qD5.17122$uq5.342051@news6-win.server.ntlworld.com>

> > Whan I use this code , it ignores the test for 'the last' and prints the
> > string with that in it anyway. Am I missing something obvious?
>
> Yes you are. On the previous line you convert spaces to &nbsp;
> so there won't be any 'the lasts' in the string anymore.
> You'll have to change that to /the&nbsp;last/
>
> You probably saw the mistake as soon as you posted your question. :-)

Doh....
Many thanks!!

Ian




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

Date: 6 Oct 2000 20:10:23 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: mod_perl and ActiveState perl (v5.6.0 618)
Message-Id: <8rlbjf$p4d$1@canopus.cc.umanitoba.ca>

In comp.lang.perl.misc oliver@ig.co.uk <oliver@ig.co.uk> wrote:
> I'm trying to get mod_perl to run with Apache (v1.3.12) and ActiveState 
> Perl (v5.6.0 618) under NT

> I can compile mod_perl successfully by changing the library files to refer 
> to the ActiveState Perl libraries, but when I attempt to use the resulting 
> DLL, I simply get application errors...

> I read an article by Sarathy (gsar@ActiveState.com) on this mailing list 
> (25th Aug) that suggested a few changes that could be made to the mod_perl 
> source to get it to work with ActiveState Perl. These changes allowed me to 
> get a working build of mod_perl, but unfortunatly it still raises an 
> application error when Apache is shutdown

> The "official" Win32 ppm build of mod_perl for Win32 (made by Randy Kobes) 
> also suffer from the same problem when Apache is shutdown...

> Can anyone help me with this?

Hi,
    It would be good to try to track this down - others who
have used this mod_perl ppm haven't found such an error. 
- if you try a non-mod_perl apache configuration, and
simply insert a line in it to load ApacheModulePerl.dll,
does the error persist? Does it occur if you simply
start and stop apache, or do you have to make certain
requests to get the error?
- are you preloading any modules? If so, can you narrow the
error down to the preloading of any one module?
- does the error occur only after making some requests?
If so, is it for any request, or just certain types?
Is there anything useful recorded in the apache error log?
Can you narrow this down to the use of one particular
module or script?
- are you using an apache binary *not* built with EAPI
support (which is needed by, for example, mod_ssl)? The
mod_perl ppm was compiled without EAPI support.
- when installing things, are you sure that any files or
libraries from possibly earlier installations aren't 
being picked up? Especially ApacheModulePerl.dll ...

If you want to compile mod_perl on your own, get
the current mod_perl cvs version (links are at
http://perl.apache.org/); this has the patches
you mention above already applied. The mod_perl
tests should all pass with this version.

best regards,
randy kobes


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

Date: Fri, 06 Oct 2000 19:13:43 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Not Entirely On Topic:  Programming and math
Message-Id: <x766n54wbc.fsf@home.sysarch.com>

>>>>> "JS" == Jonathan Stowe <gellyfish@gellyfish.com> writes:

  JS> On Thu, 05 Oct 2000 13:21:41 -0400 Lou Moran wrote:
  >> --Is a strong background in mathematics (not arithmetics) mandatory
  >> for a successful career as a programmer?
  >> 
  >> --Could a creative (musician/writer/painter/whatever) person become a
  >> "real" (read useful/good/paid) programmer without having mathematical
  >> prowess?

  JS> Yes, I have a degree in English Literature.

which proves the point of needing a math degree to be a programmer.

<but then again moronzilla claims an english phud which is a counter point>

<ducking>

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 06 Oct 2000 23:37:52 +0200
From: Maxime <maxime.fruit@libertysurf.fr>
Subject: perl locating file under a web application
Message-Id: <39DE462F.60714FC9@libertysurf.fr>

   I wonder if it is possible to locate a file name and his directory
with a web application. In fact in a web page, you will have a button
and by pushing it you will have a window or something else that will
allow you to select a file on a hard disk. Then, after that you will be
able to use the directory and the file name to use it with another
script or something else (in fact it is to update a mysql data base).

   Thank you !

  Maxime.



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

Date: Fri, 06 Oct 2000 14:43:11 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: perl locating file under a web application
Message-Id: <39DE476F.5F524283@vpservices.com>

Maxime wrote:
> 
>    I wonder if it is possible to locate a file name and his directory
> with a web application. In fact in a web page, you will have a button
> and by pushing it you will have a window or something else that will
> allow you to select a file on a hard disk. Then, after that you will be
> able to use the directory and the file name to use it with another
> script or something else (in fact it is to update a mysql data base).
> 
>    Thank you !

If I understand you correctly, you mean a file on the client's hard
disk?  You can use a file-upload field in a form that will pop up a
browse button allowing the user to browse their own hard disk and select
a file, then when they click submit the file will be uploaded to the
server where you can parse it and use it in conjunction with mysql.  The
easiest (and safest) way to do all that is with CGI.pm which has a
documentation section on the whole topic of file uploading.

-- 
Jeff


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4541
**************************************


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