[17859] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 19 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 8 18:05:48 2001

Date: Mon, 8 Jan 2001 15:05:16 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <978995115-v10-i19@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 8 Jan 2001     Volume: 10 Number: 19

Today's topics:
        ASCII to integer conversion <aichoudh@cs.uchicago.edu>
        CGI application incorrectly naming files on MACs drewbrev@my-deja.com
    Re: CGI application incorrectly naming files on MACs <joe+usenet@sunstarsys.com>
        creating GIF or JPEG with Perl <jan.mueggenburg@gmx.net>
    Re: doing something useful with utf-8 <elijah@workspot.net>
    Re: doing something useful with utf-8 <revjack@revjack.net>
        Graphing with  date strings <jramberg@looksmart.net>
    Re: Graphing with  date strings (Chris Fedde)
        How do I work out a percentage to just one decimal plac <ben.graves@virgin.net>
    Re: If I don't want to 'goto' (Craig Berry)
    Re: If I don't want to 'goto' <uri@sysarch.com>
        Image Upload Help Appreciated <jthomson110@home.com>
    Re: Internal rounding to whole numbers (Tad McClellan)
    Re: Looking for program html form to cgi (Richard Zilavec)
        Masking ps output.... bamar@my-deja.com
        Masking ps output.... bamar@my-deja.com
    Re: Modules for generating HTML Table of Contents <fvu@fvu.myweb.nl>
    Re: Need help matching multiple if's.. <W.Hielscher@mssys.com>
    Re: Need help matching multiple if's.. (Tad McClellan)
    Re: Pattern Matching <hafateltec@hotmail.com>
    Re: Problem connecting to POP3 server <don@lclcan.com>
        RTF e-mail attachment <veshi@my-deja.com>
        Sorting/matching trouble <xarbosa@yahoo.com>
    Re: splitting key/value pairs into a hash (Craig Berry)
    Re: trying to count words - not working (Craig Berry)
    Re: trying to count words - not working <joe+usenet@sunstarsys.com>
    Re: Version of AS/400 perl. <sclind@my-deja.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 8 Jan 2001 15:45:18 -0600
From: anm imroz choudhury <aichoudh@cs.uchicago.edu>
Subject: ASCII to integer conversion
Message-Id: <Pine.LNX.4.21.0101081542410.9913-100000@bleys.cs.uchicago.edu>

Hello everyone.  I have a simple question the answer to which I just can't
find anywhere.

Is there a function in perl similar to the atoi() function in C that takes
a string containing numerals, and outputs the integer that the string
represents?  I'd appreciate any help with this, thanks in advance.

Please respond to aichoudh@uchicago.edu, thanks.

roni



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

Date: Mon, 08 Jan 2001 19:34:10 GMT
From: drewbrev@my-deja.com
Subject: CGI application incorrectly naming files on MACs
Message-Id: <93d4nh$3pi$1@nnrp1.deja.com>

I am caught between 2 programming teams with a problem neither can
figure out.  We have CGI application which creates .eps files online.
Unfortionately, When we send an eps back to the browser directly using
a PC the mime filename decodes and shows the user the correct name of
the eps file.  This works PERFECTLY on the PC for either PC or Mac
flavored EPS.  On the Mac, we cannot get the name of the EPS file to
appear as the downloaded name.  This is true for both Mac and PC
flavored EPS's and on both IE and NS browsers.

Our site is hosted at Interland on an NT server. Does anyone have any
ideas on how we can correct problem?

Andy


Sent via Deja.com
http://www.deja.com/


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

Date: 08 Jan 2001 15:35:00 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: CGI application incorrectly naming files on MACs
Message-Id: <m3lmslzssr.fsf@mumonkan.sunstarsys.com>

drewbrev@my-deja.com writes:

> I am caught between 2 programming teams with a problem neither can
> figure out.  We have CGI application which creates .eps files online.
> Unfortionately, When we send an eps back to the browser directly using
> a PC the mime filename decodes and shows the user the correct name of
> the eps file.  This works PERFECTLY on the PC for either PC or Mac
> flavored EPS.  On the Mac, we cannot get the name of the EPS file to
> appear as the downloaded name.

None of this is Perl-related; try a www, CGI, or a PostScript newsgroup.
OTOH, I can't make any sense out of your description of the issue at 
hand.  When you ask there, you might explain

1) What encoding scheme are you using for the filename? 
        Base64, www-url, HTML-escaped? 

2) What exactly is wrong with the filename? missing characters?
   Didn't "decode" right?

3) What do the output headers from the webserver look like,
   and what kind of server-software are you using?
   
Again, none of this is Perl-related, so please pursue it elsewhere.
Try to include a specific example so the problem is self-evident.

HTH
-- 
Joe Schaefer



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

Date: Mon, 8 Jan 2001 21:14:52 +0100
From: "Jan Müggenburg" <jan.mueggenburg@gmx.net>
Subject: creating GIF or JPEG with Perl
Message-Id: <93d7fh$4q6$1@wrath.news.nacamar.de>

Hi,

is it possible to create GIF- or JPG-files with Perl? What modules do I need
under Perl for Win32?

My intention is to draw a graph from a data set, store the diagramm as GIF
or JPG-file and to include this file in a HTML-file.

Thanks for your help,
Jan





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

Date: 8 Jan 2001 19:35:35 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: doing something useful with utf-8
Message-Id: <eli$0101081432@qz.little-neck.ny.us>

Last Thursday, Eli the Bearded  <elijah@workspot.net> wrote:
> I've been reading 'perldoc utf8', 'perldoc perlunicode', and
> results for a dejanews search of 'utf8 in comp.lang.perl.misc',
> but I don't see anybody describing how to use perl usefully
> for UTF8 related problems.

So, do I take from the lack of response that no one does any
useful UTF8 work in perl? Or just that my problem evades the
know how of the people that post here?

Elijah
------
just thrilled at the prospect of writing a UTF-8 parser


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

Date: 8 Jan 2001 21:34:24 GMT
From: revjack <revjack@revjack.net>
Subject: Re: doing something useful with utf-8
Message-Id: <93dbp0$1k4$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Eli the Bearded <elijah@workspot.net> wrote:
: Last Thursday, Eli the Bearded  <elijah@workspot.net> wrote:
:> I've been reading 'perldoc utf8', 'perldoc perlunicode', and
:> results for a dejanews search of 'utf8 in comp.lang.perl.misc',
:> but I don't see anybody describing how to use perl usefully
:> for UTF8 related problems.

: So, do I take from the lack of response that no one does any
: useful UTF8 work in perl? Or just that my problem evades the
: know how of the people that post here?

OG NOT KNOW

OG BANG ROCKS TOGETHER, MAKE FIRE

-- 
___________________
revjack@revjack.net



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

Date: Mon, 08 Jan 2001 14:41:54 -0800
From: Jim Ramberg <jramberg@looksmart.net>
Subject: Graphing with  date strings
Message-Id: <3A5A4231.8F6BBE8F@looksmart.net>

I want to be able to use data values of the type:
Mon Jan  8 13:22:33 2001 on the x-axis of my plots.

From reading the docs; it seems that GD will not
support this. I really want to avoid converting
the date to epoch seconds since there are alot
of points.

Any suggestions.

Thanks
Jim Ramberg





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

Date: Mon, 08 Jan 2001 22:57:05 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Graphing with  date strings
Message-Id: <5Br66.773$B9.192640000@news.frii.net>

In article <3A5A4231.8F6BBE8F@looksmart.net>,
Jim Ramberg  <jramberg@looksmart.net> wrote:
>I want to be able to use data values of the type:
>Mon Jan  8 13:22:33 2001 on the x-axis of my plots.
>
>From reading the docs; it seems that GD will not
>support this. I really want to avoid converting
>the date to epoch seconds since there are alot
>of points.
>
>Any suggestions.
>
>Thanks
>Jim Ramberg
>

I think that you are kind of stuck.  Your graphing package is going to have
to do something with the x-axis data.  One way to use Time::ParseDate to
convert to epoch seconds.  Another is to look at using gnuplot to generate
your graphs. It has its own date parsing code.
-- 
    This space intentionally left blank


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

Date: Mon, 8 Jan 2001 21:49:57 -0000
From: "Ben Graves" <ben.graves@virgin.net>
Subject: How do I work out a percentage to just one decimal place?
Message-Id: <7Cq66.64298$ca6.1162879@news6-win.server.ntlworld.com>

I am trying to work out percentage values for four numbers to use in a
visitor poll.

How do I get the number to be worked out to one decimal place?

Also how do you round a value to the nearest whole number?

Thanx for any help,

Ben




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

Date: Mon, 08 Jan 2001 21:55:44 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: If I don't want to 'goto'
Message-Id: <t5kdr0eauapoa1@corp.supernews.com>

John Lin (johnlin@chttl.com.tw) wrote:
: Recently I tried to modify the structure of a program
: to avoid using 'goto'.
: 
:     for my $file (<*>) {
:         if($fail_condition1) { warn "message 1"; goto fail }
:         if($fail_condition2) { warn "message 2"; goto fail }
:         if($fail_condition3) { warn "message 3"; goto fail }
:         next;
:     fail:
:         rename $file => "fail/$file";  # move to fail/ sub directory
:     }

  my $failed = 0;

  for my $file (<*>) {
    if ($fail_condition1) { warn "message 1"; $failed = 1; last }
    if ($fail_condition2) { warn "message 2"; $failed = 1; last }
    if ($fail_condition3) { warn "message 3"; $failed = 1; last }
  }

  if (failed) {
    rename $file => "fail/$file";
  }

You can always replace a goto with a combination of flag variables and
additional tests.  The questions as to which option is clearer is
esthetic.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "The hills are burning, and the wind is raging; and the clock
   |   strikes midnight in the Garden of Allah." - Don Henley


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

Date: Mon, 08 Jan 2001 22:04:43 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: If I don't want to 'goto'
Message-Id: <x73det7lac.fsf@home.sysarch.com>

>>>>> "CB" == Craig Berry <cberry@cinenet.net> writes:


  CB>   my $failed = 0;

  CB>   for my $file (<*>) {
  CB>     if ($fail_condition1) { warn "message 1"; $failed = 1; last }
  CB>     if ($fail_condition2) { warn "message 2"; $failed = 1; last }
  CB>     if ($fail_condition3) { warn "message 3"; $failed = 1; last }
  CB>   }

  CB>   if (failed) {
  CB>     rename $file => "fail/$file";
  CB>   }

you can even factor out a little more:

	my $failed = '';

	for my $file (<*>) {
		if ($fail_condition1) { $failed = "message 1" ; last }
		$fail_condition2 and $failed = "message 2" and last ;
		$failed = "message 3" and last if $fail_condition3 ;
	}

	if ( $failed ) {
		warn $failed ;
		rename $file => "fail/$file";
	}

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: Mon, 08 Jan 2001 22:45:21 GMT
From: "James" <jthomson110@home.com>
Subject: Image Upload Help Appreciated
Message-Id: <5qr66.72461$g6.31014666@news1.elmhst1.il.home.com>

Hello, I'm trying to get a simple file upload script to work using
cgi-lib.pl version 2.18, a script
and form, all which can be found at:

Form: http://cgi-lib.berkeley.edu/ex/fup.html

Script: http://cgi-lib.berkeley.edu/ex/fup.cgi.txt

The cgi-lib site is at: http://cgi-lib.berkeley.edu/

The problem I'm having is that when an image is uploaded, it will upload ok,
but will upload to the server as a "weird" filename...not having the same
name as on my local computer.  What I want it to do is upload and save on
the server as the same name on my local computer.

Thanks,
James




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

Date: Mon, 8 Jan 2001 13:20:15 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Internal rounding to whole numbers
Message-Id: <slrn95k16v.2a1.tadmc@tadmc26.august.net>

John Hall <jhall@ifxonline.com> wrote:

>Is it acceptable to allow perl to round the value for me; 


perl is _not_ rounding the value for you...


>or is this a bad
>thing?


 ... so it is a bad thing :-)


>$indexnum = ($#histList / 3);
>
>Then I use $indexnum to grab a specific item in the array @histList. It
>works ok - 
 ^^^^^^^^

Eh?

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

my @ra = qw/ zero one two three four /;

$_ = 1.2;
print "$ra[$_]\n";

$_ = 1.8;
print "$ra[$_]\n";
-----------------------

output:

one
one

Looks like it is truncating, not rounding (it should say this
somewhere in perldata.pod, but I couldn't find it...).


>even though i'm doing nothing to round out the number.


Better do something to round the number :-)

Perl FAQ, part 4:

   "Does Perl have a round() function?  
    What about ceil() and floor()?  
    Trig functions?"


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 08 Jan 2001 18:58:03 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: Looking for program html form to cgi
Message-Id: <3a5b0d65.16561626@news.tcn.net>

On Mon, 08 Jan 2001 17:31:54 GMT, rich@mrinter.net (Hosehead) wrote:

>Sorry, It is my understanding that Perl is CGI and since I am

Perl is a programming language, CGI can be written in any language.

>Where do you suggest that I should have gone?

May try one of the comp.infosystems.www.authoring.*


--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Mon, 08 Jan 2001 19:55:04 GMT
From: bamar@my-deja.com
Subject: Masking ps output....
Message-Id: <93d5uj$4tv$1@nnrp1.deja.com>

Hi Gurus,

I have the following problem, i had written a Gui wrapper
around an executable asking for a user name and a passwd
in my script i call system("foo -user $user -passwd $passwd")
the froblem is that foo being another program forks a child and
does not exit and shows up in the ps listing giving the user name
and passwd , is there any way to get around this ??

Thanks in advance
Amarnath


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 08 Jan 2001 19:55:01 GMT
From: bamar@my-deja.com
Subject: Masking ps output....
Message-Id: <93d5ug$4ts$1@nnrp1.deja.com>

Hi Gurus,

I have the following problem, i had written a Gui wrapper
around an executable asking for a user name and a passwd
in my script i call system("foo -user $user -passwd $passwd")
the froblem is that foo being another program forks a child and
does not exit and shows up in the ps listing giving the user name
and passwd , is there any way to get around this ??

Thanks in advance
Amarnath


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 8 Jan 2001 22:07:23 +0100
From: "Freddy Vulto" <fvu@fvu.myweb.nl>
Subject: Re: Modules for generating HTML Table of Contents
Message-Id: <93da6d$87g$1@azure.nl.gxn.net>

Yes, and deja.com as well.  There doesn't seem to be any such module yet.
The manual 'perlmodlib' suggested to post to this mailgroup to be sure...

Gr, Freddy Vulto




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

Date: Mon, 08 Jan 2001 20:10:41 +0100
From: Wolfgang Hielscher <W.Hielscher@mssys.com>
Subject: Re: Need help matching multiple if's..
Message-Id: <3A5A10B1.E0C0A1B2@mssys.com>

Roger Hinson wrote:
>  This works properly, but if I
>say the 4th and 8th with a line showing
>
> if ( ($y != 3) || ($y != 7) ) {
> 
> then it doesn't ever drop down to the else.

And I'm glad it does. To enter the else-block you'd need a number that
equals both 3 and 7. I would be scared if such number exists (at least a
number that can be stored in a Perl-scalar).

In other words: Your if-condition holds for all $y.

Your condition isn't too hard to fix, because you want "a comma and a
space" if your index $y doesn't equal 3 _and_ $y doesn't equal 7.


Cheers
   Wolfgang


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

Date: Mon, 8 Jan 2001 13:06:03 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Need help matching multiple if's..
Message-Id: <slrn95k0cb.2a1.tadmc@tadmc26.august.net>

Roger Hinson <hinson@home.com> wrote:
>	Hi all,
>
>	I'm trying to take a line I've split into @splitarray and then
>recombine it, but after some words I want a comma and space, and after
>other words I want only a space.  For instance in the below example, I
>don't want a comma after the 4th word.  This works properly, but if I
>say the 4th and 8th with a line showing
>
>if ( ($y != 3) || ($y != 7) ) {
       ^^^^^^^1      ^^^^^^2


What if   $y = 100;   ?

Clause 1 is then true. Since we are doing an "or", we stop evaluating
as soon as we get a true. Clause 2 is never evaluated. The if() block
is evaluated, the else() block is not.

Same if   $y = 7;

What if   $y = 3;   ?

Clause 1 is then false. Can't stop, have to evaluate Clause 2.

Clause 2 is true, do the if() skip the else().




>then it doesn't ever drop down to the else.  Could someone explain what
>am I doing wrong, or what I should do to make it right?


Use && ("and") instead of ||.


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 9 Jan 2001 08:09:47 +1000
From: "Mike McPherson" <hafateltec@hotmail.com>
Subject: Re: Pattern Matching
Message-Id: <93dds7$hqf$1@brokaw.wa.com>

Boy  if I could only find that FAQ.  And beleive me I searched.  I will give
this a try.


Dr. Peter Dintelmann <Peter.Dintelmann@dresdner-bank.com> wrote in message
news:93bv00$9r65@intranews.bank.dresdner.net...
>     Hi,
>
> "Mike McPherson" <hafateltec@hotmail.com> wrote in message
> news:93bdo4$duv$1@brokaw.wa.com...
> > I am having some difficulty figuring out how to set up a pattern match
to
> > evaluate a ip address in the xxx.xxx.xxx.xxx format.
>
>     I thought it is somewhere in the FAQ...
>
>     What about
>
>         /^(?:\d{1,3}\.){3}\d{1,3}$/
>
>     HTH. Regards,
>
>         Peter Dintelmann
>
>
>




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

Date: Mon, 08 Jan 2001 14:12:44 -0500
From: Don <don@lclcan.com>
Subject: Re: Problem connecting to POP3 server
Message-Id: <3A5A112C.FD7B0515@lclcan.com>

Hello Gary,

Thanks for your assistance.  I did as you mentioned but I'm not sure if this
helps me or adds to the mystery.  The message I get is:

Cannot open mail server: Operation now in progress at mailtest.pl line 5.

My insticts are telling me that this may not be 100% a perlproblem but might
be related tothe OS.  I am using RedHat 7.0 and am serioulsy considering
downgrading to 6.2 ad 7.0 has giving me headaches from
time to time.

> [This message has also been posted.]
>
> On Mon, 08 Jan 2001 10:56:17 -0500, Don <don@lclcan.com> wrote:
> >Garry Williams wrote:
> >> On Mon, 08 Jan 2001 10:34:26 -0500, Don <don@lclcan.com> wrote:
> >> >When I tried the --> telnet localhost 110
> >> >
> >> >I get --> +OK POP3 localhost v7.64 server ready
> >> >
> >> >This tells me that my POP3 server is called --> localhost and is
> >> >running.
> >> >
> >> >In my perl script, I tried:
> >> >
> >> >========================================
> >> >use Net::POP3;
> >> >
> >> >my $webfile = Net::POP3->new('localhost', Port => 110, Timeout => 60)
> >> >   or die "cannot open mail server";
> >> >
> >> >exit;
> >> >========================================
> >> >
> >> >I get the message that it could not connect to the server.
> >> >
> >> >Why???
> >>
> >> How would you expect anyone here to know when you don't copy/paste the
> >> error message or the code.  That stuff you typed doesn't compile.
> >
> >I don't know what you're asking me but the entire Perl script is between
> >the ==== lines and my error message is that it dores not connect to the
> >POP3 server but dies with "cannot open mail server" which is also part of
> >my Perl script.
> >
> >I forgot to include the first line but it does compile:
> >
> >#!/usr/bin/perl -w
>
> You are correct.  It does compile.  I used the wrong module when I
> tested it. :-(
>
> However, you can help yourself by letting perl help you.  Print the $!
> variable in your error message so you can see what the error was:
>
>     $ perl
>     #!/usr/local/bin/perl -w
>     use strict;
>     use Net::POP3;
>     my $webfile = Net::POP3->new('localhost', Port => 110, Timeout => 60)
>         or die "cannot open mail server: $!";
>
>     exit;
>     cannot open mail server: Connection refused at x line 4.
>     $
>
> --
> Garry Williams



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

Date: Mon, 08 Jan 2001 20:41:21 GMT
From: Adrian <veshi@my-deja.com>
Subject: RTF e-mail attachment
Message-Id: <93d8lf$7kb$1@nnrp1.deja.com>

I'm using RTF::Document in conjunction with the MIME::Lite module to
attach a RTF file to an e-mail.  The original document appears fine,
but the e-mailed version of it contains exclamation marks in various
places throughout the document.  Any idea what could be causing this?
Is there another way to attach a file to an e-mail?
Any help is greatly appreciated.
-Adrian


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 8 Jan 2001 22:40:50 +0100
From: "xarbosa" <xarbosa@yahoo.com>
Subject: Sorting/matching trouble
Message-Id: <978989833.324956@perla.rotterdam.luna.net>

Please assist....

I have 2 arrays containing about 15.000 filenames each.
I first sort the arrays using: @array = sort(@array);
I then compare both arrays based on the value of the string by doing
something like this:

if ($left lt $right) {
    do something;
    compare next $right;
} else {
    do something else;
    compare next $left;
}

However, when I test it the arrays are not sorted by the value (higher
values appear under lower values ?!?)
Anybody know how to get them sorted by value (using lt and gt, not < and >).


Any help is highly appreciated,

    Xarbosa.





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

Date: Mon, 08 Jan 2001 21:21:49 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: splitting key/value pairs into a hash
Message-Id: <t5kbrdr4iolg5a@corp.supernews.com>

Wolfgang S. (w-s@gmx.de) wrote:
: I'm trying to build a hash from a comma-seperated key/value list,
: eg. $string  = "0, foo, 1, bar, 2, baz"
: Of course one could do it like this:
: 
:       my @map = split(/, ?/,$string);
:       for ( my $h = 0; $h <= $#map; $h+=2 ) {
:         %hash = ($map[$h] => $map[$h+1]);
:       }
: 
: but there must be a perlish way to do it in one line.

Oh yeah?

  %hash = split /, ?/, $string;

This is lousy in terms of error detection, of course; one misplaced or
missing comma and things get very messy.  But for well-formed input values
it works like a charm.

Whenever it's taking you multiple loops and maps and general cruft to do
something straightforward in Perl, you should strongly suspect you've
taken a wrong turn somewhere.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "The hills are burning, and the wind is raging; and the clock
   |   strikes midnight in the Garden of Allah." - Don Henley


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

Date: Mon, 08 Jan 2001 21:48:57 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: trying to count words - not working
Message-Id: <t5kde9drq63b0d@corp.supernews.com>

Ala Qumsieh (aqumsieh@hyperchip.com) wrote:
: Yes, but it does some unnecessary substitutions, which is a bit
: slow. Why not just:
: 
: 	$leftcnt = () = $body =~ /<left>/g;

This is my prefered solution in terms of elegance of expression.  Others
object that it needlessly builds and throws away an intermediate list; I
respond that that is an implementation and optimization issue.  But
meanwhile,

  $leftcnt = 0; $leftcnt++ while $body =~ m/<left>/g;

is good enough.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "The hills are burning, and the wind is raging; and the clock
   |   strikes midnight in the Garden of Allah." - Don Henley


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

Date: 08 Jan 2001 17:22:03 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: trying to count words - not working
Message-Id: <m3bsthznuc.fsf@mumonkan.sunstarsys.com>

cberry@cinenet.net (Craig Berry) writes:

> This is my prefered solution in terms of elegance of expression.  Others
> object that it needlessly builds and throws away an intermediate list; 

[...]

>   $leftcnt = 0; $leftcnt++ while $body =~ m/<left>/g;
> 
> is good enough.

Where do you see a list? I see m//g in the scalar context 
provided by while().


-- 
Joe Schaefer



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

Date: Mon, 08 Jan 2001 22:51:20 GMT
From: Scott Lindstrom <sclind@my-deja.com>
Subject: Re: Version of AS/400 perl.
Message-Id: <93dg95$ekb$1@nnrp1.deja.com>

In article <935gft$kbj5@emcnews1.lss.emc.com>,
  "Andre Lacroix" <lacroix_andre@emc.com> wrote:
> Can anyone tell me what AS/400 version the perl savf was created under
from
> CPAN sites?
>
> Thanks.
>
The version I run was saved under V4R3.  Not sure where I got it,
though.

Scott Lindstrom


Sent via Deja.com
http://www.deja.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 V10 Issue 19
*************************************


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