[10876] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4477 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 22 06:07:36 1998

Date: Tue, 22 Dec 98 03:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 22 Dec 1998     Volume: 8 Number: 4477

Today's topics:
        ANN: XML::Parser Version 2.17 at CPAN <coopercl@dso052.sch.ge.com>
        ANNOUNCE: DbFramework-1.04 posted to CPAN <paul@miraclefish.com>
        ANNOUNCE: File::PathConvert 0.84 (now does URLs, too) (home)
        ANNOUNCE: Net::XWhois 0.41 <news1@vipul.net>
        ANNOUNCE: Pod::Html with relative URLs (home)
        ANNOUNCE: Tie::STDERR 0.20 (Honza Pazdziora)
        ANNOUNCE: WWW::Search 1.023 <johnh@isi.edu>
        Exit status from piped commands <jjn@sanger.ac.uk>
        Image::Size 2.9 uploaded to PAUSE (Randy J. Ray)
    Re: Nested sorting (Micha3 Rutka)
    Re: One Level, Two Level, Blue Level, Purple Level (Bart Lateur)
    Re: Perl and WIN98 ActiveDesktop? <matthew.sergeant@eml.ericsson.se>
        please help with if statement syntax <asibal@paclink.com>
    Re: please help with if statement syntax (Micha3 Rutka)
    Re: please help with if statement syntax <marty@catnmoose.com>
    Re: Plot Graph with GD,chart (lhm)
        require help <marty@catnmoose.com>
    Re: require help (Bart Lateur)
    Re: Retrospective on comp.lang.perl.moderated? <PROCURA_BV@CompuServe.com>
    Re: Retrospective on comp.lang.perl.moderated? (Excession)
    Re: Turning Variables into CAPS? <kait@vacheron.ch>
    Re: Writing Perl with Notepad <imagee@image-engineering.co.uk>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 22 Dec 1998 04:19:01 GMT
From: Clark Cooper <coopercl@dso052.sch.ge.com>
Subject: ANN: XML::Parser Version 2.17 at CPAN
Message-Id: <75n6jl$vu3$1@play.inetarena.com>


Version 2.17 of XML::Parser has been posted to CPAN. XML::Parser
is a fast, flexible tool for building XML parsers. It is an extension
module based on James Clark's excellent C library for parsing XML, expat.

XML is the Extensible Markup Language, a data format for structured document
interchange on the Web. You may find out more about it by visiting the
W3C (World Wide Web Consortium) site at http://www.w3.org/XML/. You can
find out almost everything about it by visiting Robin Cover's XML page,
http://www.oasis-open.org/cover/xml.html, but be warned that this "page"
is almost 1/2 megabytes in size.

This module originated with a prototype written by Larry Wall (version 1.00).
-- 
Clark Cooper    Logic Technology Inc.		cccooper@ltionline.com
(518) 385-8380  650 Franklin St., Suite 304	coopercl@sch.ge.com
		Schenectady,  NY 12305




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

Date: 22 Dec 1998 04:20:31 GMT
From: Paul Sharpe <paul@miraclefish.com>
Subject: ANNOUNCE: DbFramework-1.04 posted to CPAN
Message-Id: <75n6mf$vuc$1@play.inetarena.com>

DbFramework is a collection of classes for manipulating Mysql
databases.  The classes are loosely based on the CDIF Data Model
Subject Area (http://www.cdif.org/).  There are methods for
representing data model objects as HTML and a class which can be
subclassed to add persistency to Perl objects.  See the POD for
further details.

The module includes a CGI application which provides an HTML forms
interface for manipulating Mysql databases.


RELEASE 1.04

= INTERFACE
  ForeignKey
    - New method as_html_form_field(\%values)
  Table
    - as_html_form() now returns fields for foreign keys too.
    - fill_template() now creates selection boxes for <DbFKey> tags.

= dbforms.cgi
  New experimental UI separating search and modify.
  Catches and displays SQL errors.

Paul




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

Date: 22 Dec 1998 04:18:05 GMT
From: "Barrie Slaymaker (home)" <rbs@lm.com>
Subject: ANNOUNCE: File::PathConvert 0.84 (now does URLs, too)
Message-Id: <75n6ht$vtr$1@play.inetarena.com>

File::PathConvert v0.84 is out.  It provides conversions from
absolute to relative and back again for URLs, Unix, DOS, MacOS, and
VMS.  

MACOS AND VMS MODES NEED LOTS OF TESTING!! HELP SAVE THE WORLD!!

Updates since the last release include:

	URL support added, tested abs2rel by updating Pod::Html.pm
	Improved POD
	Several bug fixes

The links (may need to wait for CPAN to mirror: don't get 0.83 
by accident):

http://www.telerama.com/~rbs/perl/
http://www.perl.com/CPAN/authors/id/R/RB/RBS/

Thanks!

Barrie Slaymaker




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

Date: 22 Dec 1998 04:21:27 GMT
From: Vipul Ved Prakash <news1@vipul.net>
Subject: ANNOUNCE: Net::XWhois 0.41
Message-Id: <75n6o7$vum$1@play.inetarena.com>

Net::XWhois
   A generic whois client interface class. 

Location
   ftp://vipul.net/pub/perl/Net-XWhois-0.41.tar.gz

Obsoletes
   Replaces Net::Whois. 

Brief Description

   The Net::XWhois class provides a generic client framework for doing Whois 
   queries and parsing server response.

   The class maintains an array of whois servers and associated lists of top 
   level domains they serve for transparently selecting servers appropriate 
   for different queries.  The server details are, therefore, hidden from the 
   user;  "vipul.net" (from InterNIC), gov.ru (from RIPE) and "bit.ch" (from 
   domreg.nic.ch) are queried in the same manner. This behaviour can be over-
   ridden by specifying different bindings at object construction or by
   registering associations with the class.  See register_association() and 
   new().

   One of the more important features of this module is to enable the design 
   of consistent and predictable interfaces to incompatible whois response 
   formats.  The Whois RFC (954) does not define a template for presenting 
   server data; consequently there is a large variation in layout styles as 
   well as content served across servers.

   To overcome this, Net::XWhois maintains another set of tables, parsing rule-
   sets, for a few, popular response formats. (See the section on %PARSERS). 
   These parsing tables contain section names (labels) together with regular 
   expressions that match the corresponding section text.  The section text 
   is accessed "via" these labels which are available as data instance methods 
   at runtime.  By following a consistent nomenclature for labels, semantically
   related information encoded in different formats can be accessed with the 
   same methods.

Comments, suggestions 
	mail@vipul.net






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

Date: 22 Dec 1998 04:18:45 GMT
From: "Barrie Slaymaker (home)" <rbs@lm.com>
Subject: ANNOUNCE: Pod::Html with relative URLs
Message-Id: <75n6j5$vts$1@play.inetarena.com>

I've posted an experimental patch that allows Pod::Html 
(and installhtml) to generate HTML docs with true relative URLs.  
The patch is for perl5.005_02, but the 2 patched files are also 
included and may give you some leeway...

This means that the docs can be browsed coherently
no matter where they are rooted, so file: and http: access
methods both work, and they can be moved to a new
location without a rebuild.  It seems to work on my linux box, 
but your mileage may vary.  Let me know :-).

It's in

	patch-Pod-Html-relative-0.001_01.tar

This archive includes both patch files and patched files, as 
well as a Makefile to apply the patch and run installhtml.

You should be able to get it from:

http://www.telerama.com/~rbs/perl/
http://www.perl.com/CPAN/authors/id/R/RB/RBS/

(CPAN will take a bit to mirror everywhere).

You'll also need File::PathConvert, v0.84 or later, available
from the same place.  DON'T BOTHER WITH 0.83: IT WON'T HELP!

Feel free to contact me with any updates, questions, etc.

- Barrie




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

Date: 22 Dec 1998 04:19:20 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: ANNOUNCE: Tie::STDERR 0.20
Message-Id: <75n6k8$vu4$1@play.inetarena.com>

Hello,

    http://www.fi.muni.cz/~adelton/perl/Tie-STDERR-0.20.tar.gz
 
has entered CPAN as

  file: $CPAN/authors/id/JANPAZ/Tie-STDERR-0.20.tar.gz
  size: 3190 bytes
   md5: da279ec2514629e5e1c2cb986ac036f0

This module redirects the standard error output to email, file or
process. The syntax is

	use Tie::STDERR;			# sends the output to root
	use Tie::STDERR 'adelton', 'STDERR output';	# send the output to me
	use Tie::STDERR '| logger ...';		# you guess these
	use Tie::STDERR '>> /tmp/testing.log';

The advantage is that the module catches all output, warnings coming
from -w, dies, explicit prints to STDERR. You do not need any special
treating of error conditions, just use the module at the start of your
scripts. Also, it only sends the email if there actually is something
to send, like cron does, so you do not get email for each run of the
script, only for those when something went wrong. When sending via
email, Tie::STDERR adds the %ENV info for easier debugging.

We've been using this in our CGI and non-CGI scripts for a couple of
months, and it's reasonable watcher that notifies you as soon as
something goes wrong (because of unexpected conditions, for example).
It's reasonable both during development and in the production code.

This release makes changes that enable use of Tie::STDERR even in
scripts that run under mod_perl/Apache::Registry.

Comments are appreciated,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
		Boycott the Czech Telecom -- www.bojkot.cz
------------------------------------------------------------------------




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

Date: 22 Dec 1998 04:19:44 GMT
From: John Heidemann <johnh@isi.edu>
Subject: ANNOUNCE: WWW::Search 1.023
Message-Id: <75n6l0$vu5$1@play.inetarena.com>


WWW::Search and AutoSearch
==========================


WHAT IS NEW WITH WWW::Search 1.023?  (11-Dec-98)
------------------------------------------------
overview:  primarily bug fixes for back ends

- NEW: proxy support added to WebSearch and AutoSearch
	(based on code from Paul Linder)
- NEW: new back end for Snap.com (from Jim Smyser)
- BUG FIX:  Yahoo, HotBot, Excite, Lycos (from Martin Thurn),
	NorthernLight (from Jim Smyser)


WHAT IS WWW::Search?
--------------------

WWW::Search is a collection of Perl modules which provide an API to
WWW search engines.  Currently WWW::Search includes back-ends for
variations of AltaVista, Dejanews, Excite, HotBot, Infoseek, Lycos,
Magellan, PLweb, SFgate, Verity, WebCrawler, and Yahoo.  We include
two applications built from this library: AutoSearch (an program to
automate tracking of search results over time), and WebSearch, a small
demonstration program to drive the library.  Back-ends for other
search engines and more sophisticated clients are currently under
development.

Because WWW::Search depends on parsing the HTML output of web search
engines it will fail of the search engine operators change their
format (an unfortunately frequent occurrence).  WWW::Search includes a
test suite for most back-ends which verifies that it's functioning
correctly.  As of the day of the release the current back-end
status is:

AltaVista		working
Crawler			partially working
Dejanews		working
Excite			working
ExciteForWebServers	working
Fireball		working
FolioViews		working
Gopher			not working? (not in test suite)
HotBot			partially working
Infoseek		working
Livelink		not working? (not in test suite)
Lycos			working
Magellan		working
MSIndexServer		partially working?
NorthernLight		working
Null			working
PLweb			working
Search97		working
SFgate			working
Simple			not working? (not in test suite)
Snap			partially working
Verity			not working (not in test suite)
WebCrawler		partially working?
Yahoo			working

``Paritially working'' indicates that some tests passed and some failed.
Yahoo's test suites are sometimes flakey.

(others are currently under development, see contributors below for details)



WHAT IS AutoSearch?
-------------------

WWW::Search's primary client is AutoSearch.  AutoSearch performs a
web-based search and puts the results set in a web page.  It
periodically updates this web page, indicating how the search changes
over time.  Sample output from WWW::Search can be found at
<http://www.isi.edu/lsam/tools/autosearch/>.  Output format is configurable.

See the man page for AutoSearch details, or Demonstration section
below for the quick-start instructions.



REQUIREMENTS
------------

WWW::Search requires Perl5 and libwww-perl.
For information on Perl5, see <http://www.perl.com>.
For libwww-perl, see <http://www.sn.no/libwww-perl/>.
Both are also available from the Comprehensive Perl Archive
Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN
site near you.

At this time WWW::Search is tested under Perl version 5.004_04.



AVAILABILITY
------------

The latest version of WWW::Search should always be available from
<http://www.isi.edu/lsam/tools/WWW_SEARCH/>.  Alpha releases are only
available here (not at CPAN).

WWW::Search is also available as part of CPAN.  Visit
<http://www.perl.com/CPAN/> to find a CPAN site near you.

Feedback about WWW::Search is encouraged.  If you're using it for a
neat application, please let us know.  If you'd like to (or have)
implemented a new back-end for WWW::Search, let us know so we don't
duplicate work.




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

Date: Tue, 22 Dec 1998 10:07:31 +0000
From: Jonathan Nicholson <jjn@sanger.ac.uk>
Subject: Exit status from piped commands
Message-Id: <367F6F63.D41EDDC9@sanger.ac.uk>

Hi, 

I want to run a command and capture the output from it, but I also
want to be able to capture its exit status.

Can anyone tell me if this will do what I want:-

open(CMD, "somecommand |") or die "Command failed $!\n";
@CMDOUT = <CMD>;
close(CMD);

print "somecommand ran and exited with status $? output was
\n\n",@CMDOUT;


$? should contain the output status & exit signal...

Is that right?

Closing the stream won't send a signal to the child process will it?


Hope somebody can answer these questions,

Many thanks,


Jonathan


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

Date: 22 Dec 1998 04:20:58 GMT
From: rjray@tsoft.com (Randy J. Ray)
Subject: Image::Size 2.9 uploaded to PAUSE
Message-Id: <75n6na$vud$1@play.inetarena.com>

Version 2.9 of Image::Size has been uploaded to PAUSE, and will propagate
to all CPAN sites over the next few days. Most important is a fix to a
byte-order problem in the BMP support added in 2.8.

To build and install, you will need perl 5.002 or later, and sufficient
access to install an extension.

Summary of Changes in 2.9:

* Support for BMP format in 2.8 was marred by a byte-ordering problem not
  found in testing since my Linux and Windows machines are both Intel-based.
  Sorry.

* Added a contributed fix for a recurring problem with GIF87a images that
  have descriptors similar to GIF89a.

* Added a contributed fix to the PPM matching (prior to actual selection for
  sizing) that was caused by some Win32 versions of Perl not handling "\n"
  natively.

* While at that last one, I made an attempt to fix any MacOS concerns that
  may be triggered by the same consideration.

* Added better error handling to the imgsize script and added a little more
  to the manual page.

>From the README file for 2.9:

NOTE: Version 2.9 fixes a bug in the newly-added BMP support from 2.8. The
      2.8 files will be marked for deletion from CPAN. Use this version,
      instead.

Image::Size is a library based on the image-sizing code in the wwwimagesize
script, a tool that analyzes HTML files and adds HEIGHT and WIDTH tags to
IMG directives. Image::Size has generalized that code to return a raw (X, Y)
pair, and included wrappers to pre-format that output into either HTML or a
set of attribute pairs suitable for the CGI.pm library by Lincoln Stein.
Currently, Image::Size can size images in XPM, XBM, GIF, JPEG, TIFF, PNG and
the PPM family of formats (PPM/PGM/PBM).

I did this because my old WWW server generated a lot of documents on demand
rather than keeping them in static files. These documents not only used
directional icons and buttons, but other graphics to annotate and highlight
sections of the text. Without size attributes, browsers cannot render the
text of a page until the image data is loaded and the size known for layout.
This library enables scripts to size their images at run-time and include
that as part of the generated HTML. Or for any other utility that uses and
manipulates graphics. The idea of the basic interface + wrappers is to not
limit the programmer to a certain data format.

Please send any reports of problems or bugs to rjray@tsoft.com.

This package is copyright (c) 1998 by Randy Ray (rjray@tsoft.com) and is
made available to the Perl public under terms of the Artistic License used to
cover Perl itself. See the file Artistic in the distribution  of Perl 5.002 or
later for details of copy and distribution terms.

Perl module interface by Randy J. Ray (rjray@tsoft.com), original
image-sizing code by Alex Knowles (alex@ed.ac.uk) and Andrew Tong
(werdna@ugcs.caltech.edu), used with their joint permission.

Some bug fixes submitted by Bernd Leibing <bernd.leibing@rz.uni-ulm.de>.
PPM/PGM/PBM sizing code contributed by Carsten Dominik
<dominik@strw.LeidenUniv.nl>. Tom Metro <tmetro@vl.com> re-wrote the JPG
and PNG code, and also provided a PNG image for the test suite. Dan Klein
<dvk@lonewolf.com> contributed a re-write of the GIF code. Cloyce Spradling
<cloyce@headgear.org> contributed the TIFF sizing code and test images.
A fix for reading binary data on PC-ish operating systems was contributed by
Silas Dunsmore <silasd@psyber.com>. Aldo Calpini <a.calpini@romagiubileo.it>
sent in code that was easily adapted to support BMP images (Windows bitmaps).
Fix for a recurring problem with GIF87a files contributed by Matthias Schmitt
<matthias.schmitt@mmp.lu>. Fix for problems with PPM formats on some Win32
versions was contributed by Randy Kobes <randy@theory.uwinnipeg.ca>.

-- 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray                                                    rjray@tsoft.com
Campbell, CA                                                      randy@byz.org
<A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>




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

Date: 22 Dec 1998 10:32:01 +0100
From: rutka@lucent.com (Micha3 Rutka)
Subject: Re: Nested sorting
Message-Id: <wsmyao0h69a.fsf@hzsac328.nl.lucent.com>

lr@hpl.hp.com (Larry Rosler) writes:
> In article <wsmbtkxirqa.fsf@hzsac328.nl.lucent.com> on 21 Dec 1998 
> 13:50:37 +0100, Micha3 Rutka <rutka@lucent.com> says...
> > ... Here is how you
> > can sort floats (non-negative):
> > 
> > @sorted_array_by_floats = map { substr($_,4) }
> >                           sort
> >                           map { pack("f",extract_float_from($_)).$_ }
> >                           @unsorted_array_containing_floats;
> > 
> > Simple, isn't it?
> 
> Simple, but not portable.

True and obvious for somebody who understands the code, :-). I
intentionally not mentioned non-portability in my post.

> Also, as Perl's internal representation of floating-point numbers is as 
> doubles, one would unnecessarily lose range and precision with this 
> code, possibly leading to mis-sorts.  I would use 'd' conversion into an 
> eight-byte sort key.

When I was a FORTRAN programer on machines with limitted memory, I
always carefully choosed which size to use. Short was *my*
default. However, nowdays I think that I need to change it... Still I
am mostly involved in embeded software, where memory is very expensive
resource. But you are correct, 'd' should be a default and 'f' used
only when somebody knows what he is doing.

[...]
> >    I leave this special case as an excercise (if
> > somebody *really* need it, then e-mail me).
> 
> That hardly seems necessary.  I can't imagine what your 'if-then-else 
> and xor' would do, in any case.  But how about a portable solution for 
> floating-point numbers, unsigned or signed?

Here it is (for unsigned, signed case is a simple excercise):

 @sorted_array_by_floats = map { substr($_,4) }
                           sort
                           map {
			        ($big_endian?pack("f",extract_float_from($_)):
                                       swap(pack("f",extract_float_from($_)))
                                ).$_ 
                               }
                           @unsorted_array_containing_floats;

where swap() is:

sub swap{
  my $a = shift;
  for (my $i = 0; $i < length($a)/2; $i++){
    (substr($a,$i,1),substr($a,-$i-1,1)) = (substr($a,-$i-1,1),
					    substr($a,$i,1));
  }
  return $a;
}

and $big_endian points on machine architecture. It can be a portable
function too (simple one), but as used in the map loop it is better to 
use an initialized variable (can be initialized by the function).

The code is portable now, but slower.

Regards,

Michal

-- 
Dr. Ir. Michal Rutka       Lucent Technologies - Huizen, The Netherlands
Senior System Engineer     mailto:rutka@lucent.com


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

Date: Tue, 22 Dec 1998 09:55:36 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: One Level, Two Level, Blue Level, Purple Level
Message-Id: <36816c3a.3846617@news.skynet.be>

beable@my-dejanews.com wrote:

> I went to www.perl.com and it said to look
>on CSPAN. SO I WATCHED CSPAN FOR TWELVE STRAIGHT HOURS
>AND ALL IT HAD WAS ....

You're sure it's not CPAN (without the "S")? You can simply get there
through www.perl.com .

	Bart.


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

Date: Tue, 22 Dec 1998 09:00:54 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Perl and WIN98 ActiveDesktop?
Message-Id: <367F5FC6.93606ED8@eml.ericsson.se>

brad wrote:
> 
> Would there be a way to use Active Desktop and Perl.  IE:  I would like to
> make a text form using the powers that active desktop gives me, and have a
> save button and retrieve button that would allow me to keep my notes well
> organized.  Is this possible?  I do have omnihttpd if that helps some.

Yes, using ActivePerl, and the PerlScript module, you should be able to
create a DHTML channel on your local machine to do this.

Good Luck.

-- 
<Matt email="matt@teamamiga.org" />

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: Tue, 22 Dec 1998 01:06:22 -0800
From: "amy" <asibal@paclink.com>
Subject: please help with if statement syntax
Message-Id: <75nn57$prl$1@news.us.world.net>

I'm trying to process some html form data.  I have a test of 9 questions
(radio buttons) and each question has a rank of 1-5.  So my scores range
from 9-45.  I am having trouble with the conditional statement.  I have five
possible answers. I would like my statement to read
                            if ($sum_of_test_score = 1 or 2 or 3 or 4
 ....9){
                                        conditon #1
                                } elsif ($sum_of_test_score = 10 or 11 or
12...){
                                        conditon #2
                                 }
and so on and so on until my five different outcomes were accounted for in
the if statement.
I have not been able to determine what the proper syntax would be.  I have
tried almost everything I could think of.  Please help?
Markus
asibal@paclink.com





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

Date: 22 Dec 1998 10:50:26 +0100
From: rutka@lucent.com (Micha3 Rutka)
To: asibal@paclink.com
Subject: Re: please help with if statement syntax
Message-Id: <wsmvhj4h5el.fsf@hzsac328.nl.lucent.com>

"amy" <asibal@paclink.com> writes:
> I'm trying to process some html form data.  I have a test of 9 questions
> (radio buttons) and each question has a rank of 1-5.  So my scores range
> from 9-45.  I am having trouble with the conditional statement.  I have five
> possible answers. I would like my statement to read
>                             if ($sum_of_test_score = 1 or 2 or 3 or 4
> ....9){
>                                         conditon #1
>                                 } elsif ($sum_of_test_score = 10 or 11 or
> 12...){
>                                         conditon #2
>                                  }

how about:

if($sum_of_test_score <= 9){
    conditon #1
}elsif($sum_of_test_score <= 12...){
    conditon #2
}etc.

Should do what you want.

Michal

-- 
Dr. Ir. Michal Rutka       Lucent Technologies - Huizen, The Netherlands
Senior System Engineer     mailto:rutka@lucent.com


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

Date: Tue, 22 Dec 1998 05:31:17 -0500
From: Marty Landman <marty@catnmoose.com>
To: amy <asibal@paclink.com>
Subject: Re: please help with if statement syntax
Message-Id: <367F74F5.13388220@catnmoose.com>

this'll work:

$ans = 'o';
if  ($ans eq 'a')    {print 'got it on 1';}
elsif ($ans eq 'e')    {print 'got it on 2';}
elsif ($ans eq 'i')   {print 'got it on 3';}
elsif ($ans eq 'o')  {print 'got it on 4';}
elsif ($ans eq 'u')  {print 'got it on 5';}

it looks like you used the assignment operator ('=') for comparison.  you should
use the comparison operator ('==' or 'eq') instead.

hth

amy wrote:

> I'm trying to process some html form data.  I have a test of 9 questions
> (radio buttons) and each question has a rank of 1-5.  So my scores range
> from 9-45.  I am having trouble with the conditional statement.  I have five
> possible answers. I would like my statement to read
>                             if ($sum_of_test_score = 1 or 2 or 3 or 4
> ....9){
>                                         conditon #1
>                                 } elsif ($sum_of_test_score = 10 or 11 or
> 12...){
>                                         conditon #2
>                                  }
> and so on and so on until my five different outcomes were accounted for in
> the if statement.
> I have not been able to determine what the proper syntax would be.  I have
> tried almost everything I could think of.  Please help?
> Markus
> asibal@paclink.com



--
_____ Marty Landman _______  http://www.catnmoose.com/ ______

 Living Glass           http://www.catnmoose.com/livinglass
 Mountain Man    http://www.catnmoose.com/mountainman

__________Cat 'n Moose Web Site Design & Development_________




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

Date: 22 Dec 1998 08:53:07 GMT
From: lhm@hkuspace.org (lhm)
Subject: Re: Plot Graph with GD,chart
Message-Id: <75nmlj$oks13@news.hk.linkage.net>

lhm (lhm@hkuspace.org) wrote:
: I can use chart module to write a cgi for ploting bar chart in
: perl5.004 under Solaris environment with Apache web server. I 
: am looking for the possibility to write a similar cgi under 
: win NT environment with IIS.

: I have installed the Win32 port of  GD.pm for ActivePerl 507 in
: NT WS. But everytime I try to perl xxx.pl that use GD , it will 
: dies with error "...No loadable module .." .  

: Does any one has similar problem ? Thanks for any information on 
: it.

Many thanks for the help from rico@glink.net.hk(Rico Tsang),
guide@rokura.roknet.ro (adi sorescu) . Here is the solution :

My site force all the users to use ftp proxy , I think that's why
ppm doesn't work for my case (as ppm will automatically fetch the 
files from  www.activestate.com ). So I downloaded  ppd file from
http://www.ActiveState.com/packages/ and  ???.tar.gz from 
http://www.ActiveState.com/packages/x86 and use ppm to add package
again. 

Now, I can use gifgraph module to plot graph. 

Rgds,
Phyllis



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

Date: Tue, 22 Dec 1998 05:14:57 -0500
From: Marty Landman <marty@catnmoose.com>
Subject: require help
Message-Id: <367F7120.948ADBDD@catnmoose.com>

I'd appreciate help understanding the following:

when I code

#!/usr/local/bin/perl

$reqfile = './marty.cgi';
if (-e "$reqfile" && -r "$reqfile")  {
 eval q|require "$reqfile"|;
## require "$reqfile";
 &hello;
 &goodbye;
}
else {print "Unable to require $reqfile.\n";}

exit(0);

I get the expected output from the script being required.  However when
I uncomment the require "$reqfile" and run from the command line I get:

 ./marty.cgi did not return a true value at require.cgi line 6.

>From other tests it looked like the require as above did bring in the
script, because when I use both the 'normal' require and the eval'd
require then before getting the 'did not return a true value' msg I get
messages indicating my two subroutines in the required script have been
redefined.

So what's the story?  Is eval the only proper way to do a require, or
(more likely) there's something I'm missing here?

tia
--
_____ Marty Landman _______  http://www.catnmoose.com/ ______

 Living Glass           http://www.catnmoose.com/livinglass
 Mountain Man    http://www.catnmoose.com/mountainman

__________Cat 'n Moose Web Site Design & Development_________




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

Date: Tue, 22 Dec 1998 10:46:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: require help
Message-Id: <368277b3.6784336@news.skynet.be>

Marty Landman wrote:

>I get the expected output from the script being required.  However when
>I uncomment the require "$reqfile" and run from the command line I get:
>
>./marty.cgi did not return a true value at require.cgi line 6.

Simple. Perl library files are executed when "required", which defines
the subs, and runs initializing code.

To flag that all is well, it should contain a statement that evaluates
to "true" as the very last statement executed. It's a mechanism to allow
you to stop the program if something's wrong.

Usually, it's a"1;" as the last line of the script. I bet you forgot
that.

   HTH,
   Bart.


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

Date: Mon, 21 Dec 1998 11:35:05 +0100
From: "H.M. Brand" <PROCURA_BV@CompuServe.com>
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <367E2459.AB1C070@CompuServe.com>

Larry Rosler wrote:
> 
> With year-end-assessment time rapidly approaching, would anyone care to
> comment on how comp.lang.perl.moderated has performed over its life of
> six months or so, relative to the hopes and expectations of its
> proponents?
> 
> A cost-benefit analysis at this time might be enlightening.

As someone else wrote, I did expect a little more TPJ like discussions of
the level "I think I understand, but just to be sure, I'll read it again
(twice) :-)".

The level might indeed be still higher, and the remark someone else made
that follow ups from interesting stuff of misc be transferred to moderated
sounds sane.

I was surprised by a posting rule that inhibits short answers: I was not
allowed to put two (new) lines in between an original post.

Keep up the good work!


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

Date: Tue, 22 Dec 1998 10:47:30 GMT
From: daccles@bad.spam.no.spam.pcug.org.au (Excession)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <368078a3.2905811@news.ozemail.com.au>

This never seemed to make it out, so I'm sending it again.

On Thu, 17 Dec 1998 09:03:56 -0800, lr@hpl.hp.com (Larry Rosler) wrote:

>comment on how comp.lang.perl.moderated has performed over its life of 

I was amused, most amused, to see that comp.lang.perl.misc -expanded- in
content once the moderated group got off the ground.  The wannabe purists,
slamming every Tom Dick and Harriet who deigned to ASK QUESTIONS in the .misc
newsgroup, all shouted from 'pon high that the moderated group would be _the_
place to "hang out". After they stopped oinking in .misc and left the 'endless
tides of clueless gits' to their own devices, the .misc group boomed and roared
with actual information transfer, instead of snide references to cluelessness,
or supercilious allegations of inability to read, ad fucking nauseum.

The general lack of 'oomph' in the .moderated group shows that the group of
wannabe elitist Perl gurus who were so noisily engaged in dicksize wars during
the leadup to c.l.p.moderated's inception, were just noise generators.

When the EFNET #perl channel denizens were confronted (on a few occasions) with
the 'hmm, well why didn't the .misc newsgroup die as expected', their response
was remarkable silence.  

I voted 'no' for the creation of c.l.p.moderated, because I thought it would be
fitting to have the pigs continue to wallow in their old sty; it turns out that
they mostly continued to wallow in their old sty regardless, because the lack
of action in .moderated bored most -regular- people to tears.  C'est la vie.

Perl is a great language, and a fine tool.  It really saddens me that rampant
cries of RTFM and "that's a FAQ Jack" outnumber the answers.  The 'Fish'
analogy that is pounded day and night in #perl (feed a man a fish and you feed
him for a day, give him a net, etc etc) is all well and good, but repetition of
simple answers ALONG WITH the "please view the reference material" line,
wouldn't go astray.

The people who denigrate would-be Perl users, are generally getting their kicks
from the act of denigration.  The people who genuinely help are all but drowned
out by the jeers and catcalls of the supposedly clued-in crowd.  Like any
mightier than thou group, from the outside, they look to be a collection of
pedants and buffoons, jockeying for the position of 'most exalted disher-out of
damaging repartee' rather than abiding by one of the better tenets of Perl;

Be Nice.

Yeah, right.  That would erode their veritable mountain of pride in a flash, if
these purists and fascists of the Perl community would actually practice the
'Be nice' approach to Perl queries.

Dac
[Excession/Areophany on #perl]


---
David Andrew Clayton     # Please remove NO_SPAM when 
dac@NOSPAM.pcug.org.au   # sending email replies.
I post therefore I am.   #


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

Date: Tue, 22 Dec 1998 09:18:45 +0100
From: "Kai" <kait@vacheron.ch>
Subject: Re: Turning Variables into CAPS?
Message-Id: <75nkn8$hdl$1@sibyl.sunrise.ch>

Several other possibilities besides what others have contributed :

First you can use escape sequences in strings such as :

$c = "\U$c";

- or - use string transformation such as :

$c =~ tr/[a-z]/[A-Z]/;

- or - use the uc function such as :

$c = uc($c);

The catch is that all these methodes do not handle accentuated caracters
properly. You could easily use tr/// and add specific accentuated characters
and burry it in a function.

Hope it helps, Kai.





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

Date: Mon, 21 Dec 1998 07:53:38 +0000
From: Richard Watkins <imagee@image-engineering.co.uk>
To: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Writing Perl with Notepad
Message-Id: <367DFE82.D68DF7@image-engineering.co.uk>

Why not write a perl script to strip the extra line feeds?!
Or, use a different editor on Linux (if you have to use '95 boxes to
code, you could telnet to the Linux box, assuming they are networked of
course). I use joe, seems straight forward enough.

Richard.

Jonathan Stowe wrote:
> 
> On Sat, 12 Dec 1998 19:37:32 -0500 Evan Panagiotopoulos <evanp@technologist.com> wrote:
> > This is a multi-part message in MIME format.
> > --------------31C935D452E45C802F4A6D88
> > Content-Type: text/plain; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> 
> Eeh hehe...
> 
> > I have no problems writing Perl scripts with vi.  Yesterday though, I
> > tried to write a script with Notepad but after I saved it on Linux and
> > tried to execute it gave me an error complaining about linefeeds or
> > something like that.  Can I use Notepad or different windows editor
> > for script writing? I have a class of high school students and using
> > vi is like pulling teeth.
> >
> 
> This is not a Perl thing but if you are using samba then I think that you can
> cause certain types of files to be converted appropriately.
> 
> If you want to ask questions about Samba then you should do so in a more
> appropriate neswsgroup.
> 
> >
> > begin:vcard
> > n:Panagiotopoulos;Evan
> > tel;fax:(914) 457-4056
> > tel;home:Home Sweet Home
> > tel;work:Valley Central High School (914) 457-3122
> > x-mozilla-html:TRUE
> > org:Valley Central High School;Mathematics Department
> > adr:;;;;;;
> > version:2.1
> > email;internet:evanp@technologist.com
> > title:Computer Teacher
> > fn:Evan Panagiotopoulos
> > end:vcard
> >
> 
> Now the spammers have got your telephone number as well ... ;-}
> 
> /J\
> --
> Jonathan Stowe <jns@btinternet.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>

-- 

Image Engineering - Constructing your web presence.
www.image-engineering.co.uk

5, Mayfly Close, Chatteris, Cambs, PE16 6PF
Tel: 01354 696390 Mobile: 0966 389110
email: richard@image-engineering.co.uk



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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4477
**************************************

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