[16559] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3971 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 10 00:05:32 2000

Date: Wed, 9 Aug 2000 21:05:13 -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: <965880313-v9-i3971@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 9 Aug 2000     Volume: 9 Number: 3971

Today's topics:
    Re: beginner problem (Keith Calvert Ivey)
    Re: CGI.pm not passing ampersands properly (Keith Calvert Ivey)
    Re: cleaning shell screen (Keith Calvert Ivey)
    Re: Converting from US dates/numbers to European dates/ (Keith Calvert Ivey)
    Re: Converting from US dates/numbers to European dates/ (Keith Calvert Ivey)
    Re: Create a Static HTML file from a Dynamic Source <memmett@fraser.sfu.ca>
    Re: Dereferencing correctly in regular expressions (Iain Chalmers)
    Re: Difference between a .cgi file and a .pl file? (Tim Hammerquist)
    Re: Difference between a .cgi file and a .pl file? (Tim Hammerquist)
    Re: ecologically printed perldocs (Prasanth A. Kumar)
    Re: Help with quotewords <elephant@squirrelgroup.com>
    Re: How do I dislpay all the conents in a file? thirdgc@my-deja.com
    Re: How do I dislpay all the conents in a file? (Brian Delaney)
        multi file modules <memmett@fraser.sfu.ca>
    Re: Need explanation <elephant@squirrelgroup.com>
        on-the-fly variable <andylee@taiwan.com>
    Re: on-the-fly variable <joelnelson@home.net>
    Re: on-the-fly variable <andylee@taiwan.com>
    Re: Ordered set of permutations algorithm (Keith Calvert Ivey)
    Re: Perl on NT <joelnelson@home.net>
        Problems with adding 1 thirdgc@my-deja.com
    Re: Problems with adding 1 <lauren_smith13@hotmail.com>
    Re: Problems with adding 1 <amonotod@netscape.net>
    Re: reg expressions - protect html (Alan Barclay)
    Re: Searching for errant modules (Keith Calvert Ivey)
    Re: Simple reg expression question (Keith Calvert Ivey)
    Re: Sort of a sort problem. <abe@ztreet.demon.nl>
    Re: truncate var spaces (Keith Calvert Ivey)
    Re: Upgrade 5.004 -> 5.6 and binary modules (Konstantinos Agouros)
        warning/var weirdness (or is it?) (fvw)
    Re: win32 netadmin <elephant@squirrelgroup.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 10 Aug 2000 01:06:57 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: beginner problem
Message-Id: <3995fff5.4023336@news.newsguy.com>

dbaumann@mail2.sas.upenn.edu (3) wrote:

>....When I get home tonight I will double check for errors...and try the 
>// between ($faq_directory//$filename).

No, just one slash.  You're getting mixed up with the
backslashes again.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Thu, 10 Aug 2000 00:37:32 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: CGI.pm not passing ampersands properly
Message-Id: <3992f730.1778357@news.newsguy.com>

The WebDragon <nospam@nospam.com> wrote:

>Officially the word is that & should be written as &amp; not %26 
>according to the html 4.0 spec and previous. Any HTML Validator will 
>properly report this. (cf. iCab <http://www.icab.de/>, or the w3 
>validator at <http://validator.w3.org/>

I wasn't suggesting that the & should be written as %26.  I was
saying that the browser would convert it to %26 before sending
the data to the server.  You are correct that & in the value of
the VALUE attribute of an INPUT tag -- or anywhere else in an
HTML document -- should be represented as &amp; (if that's what
you're referring to).

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Thu, 10 Aug 2000 01:13:49 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: cleaning shell screen
Message-Id: <399700f3.4277923@news.newsguy.com>

amonotod <amonotod@netscape.net> wrote:

>#!perl -w
>print "clearing the screen...\n";
>sleep 5;
>if (-d "c:/winnt") {
>  system "cls\n";
>  print "Windows...\n";
>} else {
>  system "clear\n";
>  print "*nix...\n";
>}
>print "\nThere now, isn't that nice?\n";

Not particularly.  I happen to be on Windows 95 at the moment.
You might want to consult perlvar to find out about $^O.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Thu, 10 Aug 2000 00:50:09 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <3993fa49.2570928@news.newsguy.com>

Larry Rosler <lr@hpl.hp.com> wrote:

>But I wonder how the situation of (in a French locale, 
>say)
>
>    $pi = 3,14159;
>
>is different from, in an English locale,
>
>    $pi = 3.14159;
>
>I *can* test the following:
>
>    $pi = 3 .14159;
>
>where the '.' is DWIMmed as string concatenation.  By analogy, in order 
>to get the comma interpreted as a list operator, one might need white 
>space.

I thought of that, but it seems to me that it would be
impossible to have reasonable DWIMming for things like
substr($s,2,3).  Yes, it's good to have whitespace after commas,
but do French programmers *always* space out their function
arguments?  Maybe I'm just too stuck in my locale.

(I also think that string concatenation is unlikely to be WIM
when I write

     $pi = 3 .14159;

but Perl's DWIM attempts often hide typos, unfortunately.)


-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Thu, 10 Aug 2000 00:56:49 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <3994fca5.3174966@news.newsguy.com>

Larry Rosler <lr@hpl.hp.com> wrote:

>As I said in another post, a decimal-point separator '.' is no less 
>subject to syntactic ambiguity than a decimal-comma separator ','.  
>String-concatenation operator as compared to expression separator.

In Perl perhaps, but I was speaking more generally.  In ordinary
writing lists are generally separated by commas even in Europe.
Periods are not much used for string concatenation outside Perl.

Even in Perl, numbers are far, far more often used with an
expression separator comma (especially in lists of arguments)
than with the string-concatenation operator.  When was the last
time you used . to concatenate two numbers?

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: 09 Aug 2000 20:56:30 -0700
From: Matthew Emmett <memmett@fraser.sfu.ca>
Subject: Re: Create a Static HTML file from a Dynamic Source
Message-Id: <yvw9snsdzs41.fsf@fraser.sfu.ca>

Greg Griffiths <greg2@surfaid.org> writes:

> Dear All, 
>    I've got a database driven website that has a navigation
> bar that is dynamically built from the database each time it is
> called, thus making its use in a tables based site very processor
> intensive, and Frames cause problems with the way I want the site to
> function too. So, what i want to do is this,
> 

I've just started to create a pseudo-dynamic website myself.  By
pseudo-dynamic I mean that the html files are "compiled" from
templates.  So, when I make a change to my navbar, I re-compile the
pages.  I think this is similar to what you're looking for.

Anyhow, I accomplish this with the "Template" (DBI ready) module (on
cpan.org).

I'll send some source and Makefiles if you'd like..

Matt




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

Date: Thu, 10 Aug 2000 12:34:57 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: Dereferencing correctly in regular expressions
Message-Id: <bigiain-1008001234570001@bigman.mighty.com.au>

In article <MPG.13fc9a27f9dce76c9896d5@news>, jason
<elephant@squirrelgroup.com> wrote:

>Larry Rosler writes ..
>>Actually, if I had the choice, I'd push the line the other way -- toward 
>>interpolating a simple variable only -- no array indexing or hash 
>>accessing.  (There is precedent for this elsewhere, in filehandles, for 
>>example, because of syntactic ambiguity.)
>>
>>I abhor ambiguity resolution by white space, so that, for example:
>>
>>    /$x[0]/
>>
>>interpolates the 0'th element of @x, but
>>
>>    /$x [0]/
>>
>>matches a scalar interpolation of $x followed by a space, followed by a 
>>character class containing '0'.  Does it depend on whether @x is already 
>>declared?
>
>it gets worse than that .. '[' binds so tightly that the 'index]' part 
>doesn't even need to be there .. try
>
>  print "$x[";
>
>now that's smelly (and potentially quite challenging to debug) .. of 
>course - strict helps a little .. but warn doesn't *8^(

here's some that I had to try before I was convinced about what they'd do:

@a=('a','b');
print "$a[print 'this was evaluated...']\n";
print "$a[open(FOO,'file_that_doesnt_exist')]\n";

I _guess_ thats kinda D(ing)WIM, but *boggle*!

big


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

Date: Thu, 10 Aug 2000 02:49:20 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <slrn8p46ko.11g.tim@degree.ath.cx>

Alan J. Flavell <flavell@mail.cern.ch> wrote:
> On Wed, 9 Aug 2000, Tim Hammerquist wrote:
> 
> The use of filename extensions to denote the nature of the file
> content is itself only _by convention_.  Some OSes have other
> mechanisms for doing that, like content-type fields in a file
> directory entry and so on.

Which OSes are these, I'm curious?

I left Win32 because of it's extension associations, and *nix uses the
shebang line to determine execution method.  I've only seen the
content-type method when serving documents from a web server.

-- 
-Tim Hammerquist <timmy@cpan.org>
For every problem, there is one solution
which is simple, neat and wrong.
	-- H. L. Mencken


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

Date: Thu, 10 Aug 2000 02:50:07 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <slrn8p46m7.11g.tim@degree.ath.cx>

On 09 Aug 2000 05:36:08 GMT, Abigail <abigail@foad.org> wrote:
> There is a world of difference between 'convention' and 'by definition'.

So true.  Do you remember where 'by definition' first entered the
thread?

Let it go.

-- 
-Tim Hammerquist <timmy@cpan.org>

A liar should have a good memory.
	-- Quintilian


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

Date: Thu, 10 Aug 2000 01:36:18 GMT
From: kumar1@home.com (Prasanth A. Kumar)
Subject: Re: ecologically printed perldocs
Message-Id: <m3vgx9ew31.fsf@C654771-a.frmt1.sfba.home.com>

"Brendon Caligari" <bcaligari@shipreg.com> writes:

> > >
> > >
> >
> > Brendon, did you ever find your windows docs for perl?  If not, I just
> > found a massive html gzip file on CPAN that contains all the docs.
> > It's at http://www.cpan.org/doc/manual/html/index.html - look for the
> > link labeld "gigantic GNU-zipped tarfile".
> >
> > Mj
> 
> Thanks 'mon
> 
> Same docs come pre-packed with the ActivePerl distribution...fantastic
> thing.  Haven't so far found a version of the docs in windows .hlp format.
> I like the latter because it's small, cute and convenient...often carefully
> indexed and easy to search.
> 
> Haven't found 'cheaply available' printouts of the docs. either...printed
> perlfaq-perlfaq9 and had them binded.....dared go as far as print perlfunc
> (a waste considering i had burnt a hole in my pocket with Programming Perl
> and some other texts).  However, given the 'love' many here express towards
> their perlfaqs i'm surprised they haven't been binded in leather and sold on
> amazon under the 'religious titles'.
> 
> thanks :))
> 
> Brendon

Maybe you can ask the folks at http://www.genericbooks.com/ to see if
they can print it more efficiently and cheaply? They are maily doing
it as a hobby so I don't know what to expect. I was talking to one of
them and he had a duplex printer that can could print the pages
cheaper than I estimate I ever could. However, the full doc stated
about is on the upwards of 1400 pages iirc and could still be
expensive. I think there would have to be a pooling of interest from
many people to bring the cost down.

-- 
Prasanth Kumar
kumar1@home.com


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

Date: Thu, 10 Aug 2000 03:58:36 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Help with quotewords
Message-Id: <MPG.13fcc5cfd40843e4989680@localhost>

troylachinski@my-deja.com wrote ..
>I am working on a data conversion program.  The following code works
>properly EXCEPT when $plu_descriptor contains a single quote (').  When
>this is the case all variables are empty.
>
>Sample code:
>
>use Text::ParseWords;
>while(<OLD>) { # read a line from file IN into $_
>     ($plu_number, $dept, $plu_descriptor, $nothing1,
>          $price1) = quotewords(",",0,$_);
>     print NEW "$plu_number - $dept - $plu_descriptor - $nothing1 -
>          $price1";

what difference could the value of $plu_descriptor make when you're 
overriding it with the value of quotewords ?

methinks that you might not be showing the relevant code .. you'll need 
to show more details

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Thu, 10 Aug 2000 01:10:35 GMT
From: thirdgc@my-deja.com
Subject: Re: How do I dislpay all the conents in a file?
Message-Id: <8msve9$k6s$1@nnrp1.deja.com>

Thanks. I used something similar to what you gave me.

open(post, "</home/3gc/www/ctb/posts/$file\.num") || dienice("Can't
open /home/3gc/www/ctb/posts/$file\.txt: $! \n");
@lines = <post>;
foreach (@lines) { $posts = $_; }
close(post);


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


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

Date: Thu, 10 Aug 2000 03:43:43 GMT
From: brian@socko.net (Brian Delaney)
Subject: Re: How do I dislpay all the conents in a file?
Message-Id: <399224b6.39470269@news.hwcn.org>

you can try this:

foreach $post (@time1){
print "$post\n";
}

On Wed, 09 Aug 2000 18:13:09 GMT, thirdgc@my-deja.com wrote:

>I am writing a perl script for a message board on my website. I need
>some help with a small part, how can I display all the contents in the
>file. For example I have a file with the date and time of the last post
>for a certain topic and I need the date to be displayed on the main
>board. I have tried using server side include but that didn't work. I
>also tried:
>
>open(time1, "</home/3gc/www/ctb/posts/$file\.time") || dienice("Can't
>open /home/3gc/www/ctb/posts/$file\.time: $! \n");
>@time1 = <time1>;
>close(time1);
>
>print "$time1\n";
>
>It's probably something simple that I'm forgetting to do. Thanks in
>advance for any help you can give.
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.



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

Date: 09 Aug 2000 20:46:54 -0700
From: Matthew Emmett <memmett@fraser.sfu.ca>
Subject: multi file modules
Message-Id: <yvw9ya25zsk1.fsf@fraser.sfu.ca>


Hello all,

I'm having trouble getting the following to work: I have a package
called "Roster" that I've defined through 2 files: Roster.pm and
RosterUI.pm.  Here is my constructor from Roster.pm:

package Roster;
use strict;

use Modules::RosterUI;

use Tk;

sub new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self  = {};

    bless ($self, $class);

    my ($top) = @_;

    # make top level frame
    $self->{top} = $top->Frame();

    # build the bits of the Roster
    build_StudentRoster ($self); # list of students on the right
    build_StudentDetails ($self); # student details on the left
    build_StudentActions ($self); # buttons under details pane

    # pack the top!
    $self->{top}->pack();
    
    return $self;
}

where build_StudenRoster, build_StudentDetails and
build_StudentActions are defined in RosterUI.pm.  For example,

package Roster;
use strict;

sub build_StudentRoster {
    my $self = shift;

    # blah blah
}


My problem is that build_*, when called with build_* (); doesn't work
because $self isn't defined.  I've tried playing around with different
combinations of use, require and do to include RosterUI.pm in
Roster.pm, but no success!  So, I'm wondering if what I'm trying to do
is in fact possible!  Any suggestions?

Thanks,
Matt


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

Date: Thu, 10 Aug 2000 01:40:06 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Need explanation
Message-Id: <MPG.13fca55921d2a5d39896d9@news>

Walt Mankowski writes ..
>Rashid Saharudin <rashid1218@hotmail.com> writes:
>
>> }
>> 
>> $data =~ s/'[^']*'//g;    =>> why is it outside the loop???
>
>It would work either way, but it's more efficient to do it at the
>end.

actually it will work differently inside the loop .. consider the fact 
that [^'] matches newlines

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Thu, 10 Aug 2000 09:54:42 +0800
From: Andy <andylee@taiwan.com>
Subject: on-the-fly variable
Message-Id: <39920B62.38BB1715@taiwan.com>

Can anybody tell me how to set an on-the-fly variable in Perl? I will
use this variable for calculating, and this variable can be updated
on-the-fly on the browser but no any database to hold the value of it.

Thanks for any helps.

Andy.L




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

Date: Thu, 10 Aug 2000 03:18:55 GMT
From: Joel Nelson <joelnelson@home.net>
Subject: Re: on-the-fly variable
Message-Id: <39921EF6.799F7539@home.net>

Andy wrote:

> Can anybody tell me how to set an on-the-fly variable in Perl? I will
> use this variable for calculating, and this variable can be updated
> on-the-fly on the browser but no any database to hold the value of it.

Say what????????? If that's not confusing, I don't know what is.

Joel



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

Date: Thu, 10 Aug 2000 11:46:55 +0800
From: Andy <andylee@taiwan.com>
Subject: Re: on-the-fly variable
Message-Id: <399225AF.EF697BC9@taiwan.com>

Sorry for made you confusing, but actually, I want to write a shopping cart
program that can calculate the total price when the user add the items to
the shopping cart. And the total price will calculating and updating
frequently.

If you have time, please go to http://www.bigboxx.com/  to see what I am
saying, you may see that on the left hand side of the page, a TOTAL value is
displayed in the Shopping Cart section lively when you add the items, I just
want to write a program like it...

And I don't want to use the cookie, and thanks for your help!

Andy.L

Joel Nelson ¼g¤J¡G

> Andy wrote:
>
> > Can anybody tell me how to set an on-the-fly variable in Perl? I will
> > use this variable for calculating, and this variable can be updated
> > on-the-fly on the browser but no any database to hold the value of it.
>
> Say what????????? If that's not confusing, I don't know what is.
>
> Joel



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

Date: Thu, 10 Aug 2000 01:24:52 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Ordered set of permutations algorithm
Message-Id: <3998038c.4942392@news.newsguy.com>

logan@cs.utexas.edu (Logan Shaw) wrote:

>The interesting thing about this problem is that subproblems recur
>frequently in it.  This means it could benefit from a dynamic
>programming approach, and possibly a great deal since the subproblems
>are going to be repeated pretty frequently.  I haven't thought of a
>dynamic programming algorithm for it yet, though.  ;-)

You could use memoization:

    http://www.plover.com/~mjd/perl/Memoize/

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Thu, 10 Aug 2000 03:15:27 GMT
From: Joel Nelson <joelnelson@home.net>
Subject: Re: Perl on NT
Message-Id: <39921E25.46DFD065@home.net>

Chris Gifford wrote:

> I have a NT4 Server running Apache Web Server and I cant seem to get and
> forms with cgi/perl scripts working.  Does anyone know of any scripts that
> work on NT servers for sending forms and does not require downloading extra
> software?

Hmmmm?

Myself and everyone else have been doing this forever. Okay, not forever. You
need to tell us what the specific problem/error is. Have you installed the
binary Apache? The activestate binary for perl? Did you try:

#!c:\perl\bin\perl

use CGI qw(:standard);

print
header,
start_html,
start_form,
textfield(-name=>'test'),
br,
"type something!,
end_form,
end_html;

No extra software needed. Let's see your real problem please!

Joel



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

Date: Thu, 10 Aug 2000 01:15:36 GMT
From: thirdgc@my-deja.com
Subject: Problems with adding 1
Message-Id: <8msvnm$kh0$1@nnrp1.deja.com>

I am trying to open a file and raise the number by one, but instead of
raising it one, it changes the number to one. This is what I use to do
it:

open(postnum, "</home/3gc/www/ctb/posts/$num\.num") || dienice("Can't
open $num\.num: $! \n");
@postnum = <postnum>;
close(postnum);

$postnum ++;

open(postnum1, "+>/home/3gc/www/ctb/posts/$num\.num") || dienice("Can't
open $num\.num: $! \n");
print postnum1 "$postnum\n";
close(postnum1);

Thanks for any help in advance.

Chris


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


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

Date: Wed, 9 Aug 2000 19:10:52 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Problems with adding 1
Message-Id: <8mt2s1$8b0$1@brokaw.wa.com>


<thirdgc@my-deja.com> wrote in message news:8msvnm$kh0$1@nnrp1.deja.com...
> I am trying to open a file and raise the number by one, but instead of
> raising it one, it changes the number to one. This is what I use to do
> it:
>
> open(postnum, "</home/3gc/www/ctb/posts/$num\.num") || dienice("Can't
> open $num\.num: $! \n");
> @postnum = <postnum>;
> close(postnum);

Ask the person who wrote this why he escaped the period.  The slash is
totally superflous.

> $postnum ++;
>
> open(postnum1, "+>/home/3gc/www/ctb/posts/$num\.num") || dienice("Can't
> open $num\.num: $! \n");
> print postnum1 "$postnum\n";
> close(postnum1);

Your problem is that you are confused about Perl's built-in data types.

@postnum is not $postnum.

See the perldata documentation for a complete description of Perl's data
types.

Type 'perldoc perldata' into your closest command line.

Lauren





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

Date: Thu, 10 Aug 2000 02:46:07 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Problems with adding 1
Message-Id: <8mt51f$nvo$1@nnrp1.deja.com>

In article <8msvnm$kh0$1@nnrp1.deja.com>,
  thirdgc@my-deja.com wrote:
> I am trying to open a file and raise the number by one, but instead of
> raising it one, it changes the number to one. This is what I use to do
> it:
>
> open(postnum, "</home/3gc/www/ctb/posts/$num\.num") || dienice("Can't
> open $num\.num: $! \n");
> @postnum = <postnum>;
  ^^^^^^^^

> close(postnum);
>
> $postnum ++;
  ^^^^^^^^

>
> open(postnum1, "+>/home/3gc/www/ctb/posts/$num\.num") ||
dienice("Can't
> open $num\.num: $! \n");
> print postnum1 "$postnum\n";
> close(postnum1);
>
> Thanks for any help in advance.
>
> Chris

Looks to me like you are incrementing $postnum, but the variable you are
slurping in is called @postnum...  Fix that, you'll be a lot better
off...

amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: 10 Aug 2000 01:22:19 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: reg expressions - protect html
Message-Id: <965870521.205236@elaine.furryape.com>

In article <MPG.13fa076db2e4000b98ac4d@nntp.hpl.hp.com>,
Larry Rosler  <lr@hpl.hp.com> wrote:
>Note that NoWarnStrict is slower than WarnStrict.  I don't conclude from 
>this that '-w' speeds a program up, though.  In fact, I find no 
>sgnificance in this data set at all.

I agree with Larry here. I ran each of the benchmarks 10 times each, and got
these results (Sorted for ease of comparision):

	
NoWarnNoStrict: 18 wallclock secs (18.46 usr +  0.03 sys = 18.49 CPU)
NoWarnNoStrict: 18 wallclock secs (18.60 usr +  0.00 sys = 18.60 CPU)
NoWarnNoStrict: 19 wallclock secs (18.48 usr +  0.08 sys = 18.56 CPU)
NoWarnNoStrict: 19 wallclock secs (18.50 usr +  0.06 sys = 18.56 CPU)
NoWarnNoStrict: 19 wallclock secs (18.50 usr + -0.00 sys = 18.50 CPU)
NoWarnNoStrict: 19 wallclock secs (18.51 usr +  0.08 sys = 18.59 CPU)
NoWarnNoStrict: 19 wallclock secs (18.52 usr +  0.03 sys = 18.55 CPU)
NoWarnNoStrict: 19 wallclock secs (18.53 usr +  0.02 sys = 18.55 CPU)
NoWarnNoStrict: 19 wallclock secs (18.53 usr +  0.05 sys = 18.58 CPU)
NoWarnNoStrict: 19 wallclock secs (18.62 usr + -0.01 sys = 18.61 CPU)

WarnNoStrict: 17 wallclock secs (17.98 usr +  0.00 sys = 17.98 CPU)
WarnNoStrict: 17 wallclock secs (18.06 usr +  0.00 sys = 18.06 CPU)
WarnNoStrict: 18 wallclock secs (17.93 usr +  0.00 sys = 17.93 CPU)
WarnNoStrict: 18 wallclock secs (17.97 usr +  0.00 sys = 17.97 CPU)
WarnNoStrict: 18 wallclock secs (18.09 usr + -0.02 sys = 18.07 CPU)
WarnNoStrict: 18 wallclock secs (18.03 usr +  0.02 sys = 18.05 CPU)
WarnNoStrict: 19 wallclock secs (17.97 usr +  0.00 sys = 17.97 CPU)
WarnNoStrict: 19 wallclock secs (18.00 usr +  0.00 sys = 18.00 CPU)
WarnNoStrict: 21 wallclock secs (18.00 usr +  0.00 sys = 18.00 CPU)
WarnNoStrict: 21 wallclock secs (18.02 usr +  0.04 sys = 18.06 CPU)

WarnStrict: 18 wallclock secs (17.89 usr +  0.06 sys = 17.95 CPU)
WarnStrict: 18 wallclock secs (17.95 usr +  0.01 sys = 17.96 CPU)
WarnStrict: 18 wallclock secs (18.00 usr +  0.00 sys = 18.00 CPU)
WarnStrict: 18 wallclock secs (18.06 usr +  0.00 sys = 18.06 CPU)
WarnStrict: 18 wallclock secs (18.07 usr +  0.03 sys = 18.10 CPU)
WarnStrict: 19 wallclock secs (17.96 usr +  0.03 sys = 17.99 CPU)
WarnStrict: 19 wallclock secs (18.02 usr +  0.03 sys = 18.05 CPU)
WarnStrict: 20 wallclock secs (17.87 usr +  0.09 sys = 17.96 CPU)
WarnStrict: 20 wallclock secs (18.01 usr + -0.02 sys = 17.99 CPU)
WarnStrict: 20 wallclock secs (18.06 usr +  0.02 sys = 18.08 CPU)

As you can see, even if the benchmark is rerun without changing anything,
there is a variation of as much as 4 wallclock seconds. All of the
ranges of times overlap, and because of this, any ordering of results
is possible.


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

Date: Thu, 10 Aug 2000 02:25:09 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Searching for errant modules
Message-Id: <399f103f.8193771@news.newsguy.com>

soren@spmfoiler.removethat.wonderstorm.com (Soren Andersen)
wrote:

>Flavell, you are such a complete idiot (nothing "personal" though). I have 
>seen you flaming people in these groups for years. You don't speak for ME. 
>I *liked it* that I got to see that the poster got an answer and 
>appreciated it. That's closure.

If you've been reading these groups for years, I'm surprised you
don't greatly prefer Alan's informative posts to a clutter of
"thank you" messages (with giant quotes hanging off the end)
intended for other people, but there's no accounting for taste.
Alan is sometimes crotchety (if that word can be applied to
people under 80) when dealing with the posts that represent the
noise in the signal-to-noise ratio, but he's definitely one of
the people I'll score up when I get around to installing a
scoring newsreader Real Soon Now, especially in the
comp.infosystems.www.* groups.

>Welcome to my killfile, I have no idea why it took me so long to add you.

Your loss.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Thu, 10 Aug 2000 02:49:59 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Simple reg expression question
Message-Id: <39a015a0.9571037@news.newsguy.com>

"Kenny Lim" <kennylim@techie.com> wrote:

>Scenario 1 :
>
>Incrementing the minor version by +1,+2,+3 for ETProj59 will result in 510,
>511, 512
>rather than  ETProj60, ETProj61, ETProj62. (That's a big jump from version
>59 to 510,
>5.9 to version 51.0)
>
>Scenario 2 :
>
>Incrementing the minor version by +1,+2, +3 and etc. for ETProj599 will
>result in 5100 rather
>than 600, 601, 602.
>
>Scenario 3 :
>
>Incrementing the minor version by +1,+2,+3 and etc. for ETProj999 will
>result in 1099 rather
>than 1000, 1001, 1002.

I don't understand how you get 1099 there rather than 9100 as in
scenario 2.  Regardless, from your desired answers I can't
figure out how you want the behavior of your version numbers to
differ from that of ordinary integers.  There doesn't seem to be
any significance to the concepts of major and minor versions,
since incrementing the minor version can cause the major version
to increment, while incrementing the major version doesn't reset
the minor version.

I think that if you sit down and work through exactly what you
want to happen for various scenarios and try to express it in
pseudocode, things will be a lot clearer.  This is really not a
Perl question anymore, but a question of clear description.

And please stop posting these messages in two separate threads.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Thu, 10 Aug 2000 03:29:38 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Sort of a sort problem.
Message-Id: <h504pssi50sa8fql3j6n8513j1tifrkhtq@4ax.com>

On Wed, 09 Aug 2000 20:23:38 -0400, Stephen Kloder
<stephenk@cc.gatech.edu> wrote:
 ...
> Or, use a one-to-one transformation, which can be easily undone:
> @sortedfiles = @files;
> s/^(\w+?)(\d+)$/$2$1/ foreach (@sortedfiles);
> @sortedfiles = sort @sortedfiles;
> s/^(\d+)(\w+)$/$2$1/ foreach (@sortedfiles);

Which works as long as all numbers have the same number of digits.

Better to fix the number of digits (4 in my case):

	my @sorted = map substr($_, 4) => sort
		map { /(\d+)/; sprintf("%04u", $1).$_ } @files;

-- 
Good luck,
Abe


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

Date: Thu, 10 Aug 2000 02:13:10 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: truncate var spaces
Message-Id: <399a0f4b.7950181@news.newsguy.com>

fg19537@my-deja.com wrote:

>Is there a better perl programming method of truncating the white spaces
>at the end of a variable (while leaving internal spaces alone) than what
>I show below? (setting var 3 times)
[snip]
>    $fname = $$row[0];
>    $fname =~ s/^\s+//;
>    $fname =~ s/\s+$//;

If the spaces are only at the end of the variable (as they
appear to be from your examples), you can leave out the second
line, which deletes whitespace at the beginning.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: 9 Aug 2000 21:52:21 +0200
From: elwood@news.agouros.de (Konstantinos Agouros)
Subject: Re: Upgrade 5.004 -> 5.6 and binary modules
Message-Id: <elwood.965850696@news.agouros.de>

In <Lg2k5.14492$f_5.71160@news1.rdc1.ct.home.com> Dan Sugalski <dan@tuatha.sidhe.org> writes:

>Konstantinos Agouros <elwood@news.agouros.de> wrote:
>> Hi,

>> I am currently running 5.004 and I want to upgrade. I have quite a number
>> of binary modules installed (some written by me). Does this work? I remember
>> that I have seen a question 'backward compatibility for binary modules' in 
>> older version of perl. Is this still so?

>Perl 5.6.0 can be built with support for 5.005 modules. Binary
>compatibility was broken between perl 5.004 and 5.005. Too much changed
>under the hood to maintain it.
So in that case I can say no to binary compatibility and build it all again 
anyway. Thanks for saving my some work \:)

Konstantin

>					Dan
-- 
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres


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

Date: Thu, 10 Aug 2000 03:47:36 GMT
From: fvw+usenet@var.cx (fvw)
Subject: warning/var weirdness (or is it?)
Message-Id: <965879311ZGS.fvw@var.cx>

I have the following code:

#!/usr/bin/perl -w
my $a='foo';
my $b="${a}${a}[";
print $b;

I would expect this to print "foofoo[", but instead it prints "foo["
and complains:
Name "main::a" used only once: possible typo at test.pl line 5.
Use of uninitialized value at test.pl line 5.

If I remove the '[' it behaves as expected. I'm using perl
'version 5.005_03 built for i386-linux'. 

Is this bug in me or in perl? :-)

-- 

                        Frank v Waveren
                        fvw@var.cx
                        ICQ# 10074100


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

Date: Thu, 10 Aug 2000 01:37:16 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: win32 netadmin
Message-Id: <MPG.13fca4b44adb00759896d8@news>

Jason Hurst writes ..
>I’m trying to validate a user with perl through our domain.  I found
>the netadmin package and tried using the UserGetAttributes function.

try using AdminMisc from Roth Consulting instead

  http://www.roth.net/perl/adminmisc

-- 
  jason -- elephant@squirrelgroup.com --


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

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 3971
**************************************


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