[7477] in Perl-Users-Digest
Perl-Users Digest, Issue: 1103 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 30 08:17:09 1997
Date: Tue, 30 Sep 97 05:00:43 -0700
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, 30 Sep 1997 Volume: 8 Number: 1103
Today's topics:
re: Advanced Perl Programming arw@pythonpros.com
Re: any faith in me? <seay@absyss.fr>
Re: Anyone ever written to a GIF file from perl gwynp_no_uce@artware.qc.ca
Re: cgi data <ccr@jordan.uni-paderborn.de>
Re: Columns in Perl <seay@absyss.fr>
connect() and sockets <tekman@aimnet.com>
Re: connect() <seay@absyss.fr>
Getopt::Long (Mathias Koerber)
Re: Getopt::Long (Johan Vromans)
Re: getting file fro ma remote computer ? (Ben Reser)
Re: Hash of subroutine calls <seay@absyss.fr>
Re: Help with system() <seay@absyss.fr>
Re: Makefile out of date... (Ben Reser)
Re: New Perl syntax idea <seay@absyss.fr>
Re: Newbie ques: How to concatenate two strings? <seay@absyss.fr>
Re: newbie question : crypt library (Ben Reser)
Re: Options & No Wrong Answers (Tad McClellan)
Perl version mismatch (C E Havlioglu)
Perl version mismatch: SORTED (C E Havlioglu)
Re: Perl4 is *not* Y2K (was Re: Y2K) <seay@absyss.fr>
Re: Recursive object reader (Ben Reser)
Re: Test for alphabetic character? (Ben Reser)
Re: What does the . operator do? (Matti Kinnunen)
Re: XS (Toad)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 Sep 1997 05:33:15 -0600
From: arw@pythonpros.com
Subject: re: Advanced Perl Programming
Message-Id: <875613879.25021@dejanews.com>
In article <342FC07C.C81E9E6B@weblogic.com>,
Sriram Srinivasan <sriram@weblogic.com> wrote:
> Every assertion in the book has been tested with at least one
> code snippet (including those that don't have anything to do with
> code ... when I say Perl is faster than Python for a number of
> text processing tasks, I have at least 10 programs to prove that).
This is Perl's home turf where it really shows its stuff. After
all regexen are part of the *language* (in Python they are
extension modules). Definitely if you don't do much after you've
parsed the text I'd expect Perl to be faster. Faster than Python 1.4
that is. Better retest against Python 1.5 when it comes out
(if my alpha is any indication :) ). Still, speed kills.
-- Aaron Watters
===
http://starship.skyport.net/crew/aaron_watters/bplustree/term.cgi?1394097
Pay no attention to the man behind the curtain!
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 30 Sep 1997 13:22:01 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: any faith in me?
Message-Id: <3430E0D9.4D4900AC@absyss.fr>
BrAnCh wrote:
>
> Hi,
>
> I learned HTML form Laura Lemay's Teach yourself web publishing with
> HTML 3.2 in a week.
> and now i'm working on Teach yourself CGI programming with perl5 in a
> week (Eric Herrmann)
> is this enough for me to learn with, or would you suggest I read
> something else first??
To start with, your Subject: line is terrible. There is a mini-FAQ
posted every week about what a Subject: line should contain.
I'd say start with the man pages. Everything you need is there. I've
never read it, but Randal's _Learning Perl_ (man perlbook for the ISBN)
has been well recomended. Once you know Perl fairly well, the Camel is
your friend (again, the ISBN is in perlbook). Have you been to
http://www.perl.com/ to look at TomC's ranking of Perl books? Somewhat
opionated, but that isn't anything special on the 'net.
- doug
------------------------------
Date: Tue, 30 Sep 1997 09:35:53 GMT
From: gwynp_no_uce@artware.qc.ca
Subject: Re: Anyone ever written to a GIF file from perl
Message-Id: <3430c7af.12540833@news.videotron.ca>
On Mon, 29 Sep 1997 13:55:40 -0400, ken@forum.swarthmore.edu (Ken
Williams) wrote:
>Yup, I've done this before, and I have zero expertise on the file format
>of GIF files. I used GD.pm, which probably stands for Graphics Drawing or
>something like that. But definitely investigate this package, it will
>make your work much easier if you want to create GIFs from inside a Perl
>script.
>
>In article <EH9o6y.37J.C.amo@bath.ac.uk>, ab6rah@bath.ac.uk (R A Hart) wrote:
>
>>I was wondering if anybody has any example code to write a GIF file (or
>>something that most browsers can read) from say a 2-d array of colourvalues.
>>
>>It needn't be too complex (i.e. I'll only want to do single images,
>>256-colours, and only the control blocks necessary to get the image onto
>>the screen.)
GD.pm or PerlMagick, an interface to the ImageMagick library. All
available at a CPAN near you.
-Philip
------------------------------
Date: Tue, 30 Sep 1997 13:00:21 +0200
From: Christopher Creutzig <ccr@jordan.uni-paderborn.de>
Subject: Re: cgi data
Message-Id: <Pine.GSO.3.95.970930125757.207B-100000@jordan.uni-paderborn.de>
On 25 Sep 1997, Creede Lambard wrote:
> Oops. Right you are. That should read:
>
> if ($s =~ /$id/) { . . . code to execute if ID matches . . . }
Doesn't that allow simply entering "." or ".*" as a key? You should
ensure that $id =~ /^[0-9]{10}$/ first.
regards,
Christopher Creutzig
------------------------------
Date: Tue, 30 Sep 1997 12:11:08 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Columns in Perl
Message-Id: <3430D03C.3226730@absyss.fr>
Yash Khemani wrote:
>
> Dean Dixon wrote:
> >
> > You know how in awk you can use NF to get the number or fields or
> > columns
> > How can I do this in Perl
>
> i assume you mean "how do i get the number of fields in a list/array?"
> for list @list, $#list indicates the field number of the last element
> in @list; the field number for the first element is 0. so for
>
> @list = ('a','b','c','d');
>
> do
>
> print "$#list\n";
>
> and you will see that $#list in this case is 3.
And scalar(@list) will return 4.
- doug
------------------------------
Date: Tue, 30 Sep 1997 01:59:48 -0700
From: Khayman <tekman@aimnet.com>
Subject: connect() and sockets
Message-Id: <3430BF84.3CB7@aimnet.com>
'lo there, I've been working with Perl and got myself a problem. I
wrote an IRC bot in Perl some months back, but my isp was hacked and all
my files gone. Unfortunately I cannot remember how to setup the
connection with an IRC server. Any and all help would be greatly
appreciated, esp. if someone could provide me with a connection routine.
Thank you kindly...
tekman@aimnet.com
------------------------------
Date: Tue, 30 Sep 1997 12:47:08 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: connect()
Message-Id: <3430D8AC.3C777A9C@absyss.fr>
Khayman wrote:
>
> Hey there, I'm working on an IRC Bot in Perl, had one previously but my
> isp got hacked and all my coding was lost. I can't get my connection
> routine working again and it's terribly frustrating. If someone could
> please drop me an email to tekman@aimnet.com with some help, or even a
> complete connection routine I would be most thankful :-)
perldoc IO::Socket should do the trick
- doug
------------------------------
Date: 30 Sep 1997 09:28:57 GMT
From: mathias@singapura.singnet.com.sg (Mathias Koerber)
Subject: Getopt::Long
Message-Id: <60qgop$6u7$1@columbine.singnet.com.sg>
I am just trying to use Getopt::Long and came across the following:
To use the 'alternative' form of calling GetOptions, one cal define
the linkages like this:
%optctl = (
"action" => \$action,
"domain" => \$domain,
"submitter" => \$submitter,
"mailto" => \$mailto,
"group" => \$groups,
"debug" => \$debug,
);
Hoewver, one still would need to define the actual options and their
parameter expectations:
@options = ( "action=s", "domain=s", "submitter=s", "mailto=s", "group=s", "debug!" );
So that one can call:
&Getopt::Long::GetOptions(\%optctl, @options);
One still needs to define the options twice, once in %optctl for
the linkages, and once their parameters. GetOptions does not
recognize the parameter definitions inside the hash :-(
It would be nice if this worked (note the use of the parameter definitions
in the %optctl hash!)
%optctl = (
"action=s" => \$action,
"domain=s" => \$domain,
"submitter=s" => \$submitter,
"mailto=s" => \$mailto,
"group=s" => \$groups,
"debug!" => \$debug,
);
&Getopt::Long::GetOptions(\%optctl);
or maybe
&Getopt::Long::GetOptions(\%optctl, keys(%optctl));
Is there a trick that can make it easier to maintain these option definitions?
Any help is welcome
Mathias
--
Mathias Koerber | Tel: +65 / 471 9820 | mathias@staff.singnet.com.sg
SingNet NOC | Fax: +65 / 475 3273 | mathias@koerber.org
Q'town Tel. Exch. | PGP: Keyid: 768/25E082BD finger mathias@singnet.com.sg
2 Stirling Rd | 1A 8B FC D4 93 F1 9A FC BD 98 A3 1A 0E 73 01 65
S'pore 148943 | Disclaimer: I speak only for myself
A committee is a group of people who individually can do nothing, but
collectively decide that nothing can be done.
-??
------------------------------
Date: 30 Sep 1997 13:29:38 +0200
From: JVromans@Squirrel.NL (Johan Vromans)
Subject: Re: Getopt::Long
Message-Id: <wl37mbzca59.fsf@plume.nl.compuware.com>
mathias@singapura.singnet.com.sg (Mathias Koerber) writes:
> To use the 'alternative' form of calling GetOptions, one cal define
> the linkages like this:
>
...
> It would be nice if this worked (note the use of the parameter definitions
> in the %optctl hash!)
>
> %optctl = (
> "action=s" => \$action,
> "domain=s" => \$domain,
> "submitter=s" => \$submitter,
> "mailto=s" => \$mailto,
> "group=s" => \$groups,
> "debug!" => \$debug,
> );
>
> &Getopt::Long::GetOptions(\%optctl);
Use
GetOptions(%optctl);
(Note: no backslash before %optctl)
or:
GetOptions (
"action=s" => \$action,
"domain=s" => \$domain,
"submitter=s" => \$submitter,
"mailto=s" => \$mailto,
"group=s" => \$groups,
"debug!" => \$debug,
);
------------------------------------------------------------------------------
Johan Vromans jvromans@squirrel.nl
Squirrel Consultancy Haarlem, the Netherlands
http://www.squirrel.nl http://www.xs4all.nl/~jvromans
PGP Key 2048/4783B14D KFP = 65 44 CA 66 B3 50 0B 34 CE 0E FB CA 2D 95 34 D0
------------------------ "Arms are made for hugging" -------------------------
------------------------------
Date: Tue, 30 Sep 1997 08:46:43 GMT
From: ben@reser.org (Ben Reser)
Subject: Re: getting file fro ma remote computer ?
Message-Id: <3430bc10.25654188@192.168.0.1>
Consider looking into the LWP module and the HTML::Parse Module.
They are both included in this file:
http://www.perl.com/CPAN-local//modules/by-module/LWP/libwww-perl-5.13.tar.gz
On Mon, 29 Sep 1997 20:57:32 +0200, "Gal Samuel" <nakadina@ibm.net>
wrote:
> Hello ,
>
>Can someone suggest a good way to open a file for further handling from an
>Internet URL ?
>
>program should:
>1. read the remote file. (let's say from http://www.xxxx.com/)
>2. store it localy.
>3. set variables from the file's data.
>4. calculate function with these variables.
>5. printout the calculations.
>
>I'm most intrested in an answer to line 1 of the program; the rest I'm
>fimiliar with.
>
>Thanks for your time.
>Gal Samuel
>mailto:nakadina@ibm.net
>
>
>
************************* IMPORTANT *************************
Why the new email address you ask?
Simple, I'm attempting to simplify the way I filter my mail.
Please direct all personal mail to ben@reser.org
Not directing personal mail to this address may cause
delays in me reading your mail or may even get it deleted.
************************ IMPORTANT *************************
---
Ben Reser <ben@reser.org>
http://ben.reser.org
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d-(+)@ s:- a-- C++++$ UBVC++++(++)$ P+++$>++++ L- !E---- W@ N(+)>++ o? K--? w++$@>+++ !O---- !M V PS+(++)@>+++ PE++(+++)@ Y+(++)@ PGP+(++)>+++ t+()@ 5 X !R tv-(+)@>-- b+(++)>+++ DI++ D G e h++ r-()>+++ y?
------END GEEK CODE BLOCK------
------------------------------
Date: Tue, 30 Sep 1997 11:37:13 +0200
From: Doug Seay <seay@absyss.fr>
To: Daveotlc <daveotlc@aol.com>
Subject: Re: Hash of subroutine calls
Message-Id: <3430C849.1FF97194@absyss.fr>
[posted and mailed]
Daveotlc wrote:
>
> Thanks, Greg. Playing around, I couldn't get the -> notation to work.
> But this got me past the syntax scan.
IIRC $codref->(@arglist) is new with 5.004. If you are using something
older, you'll need to upgrade. This is another brain child of Randal
Schwartz.
> my $doit = $lang_routine{$this_language};
> next MEMBER_LINE if &$doit ($data,$lang_state,$comment_sw);
I still do this way for code references, but mostly because I just found
out about the other way last week.
> Unfortunately, that's not quite enough to solve my problem. Now I've run
> into something in the plug-in itself. In a little more detail, it looks
> like this:
>
> $this_language = 'Visual Basic';
> $lang_routine{$this_language} =
> {
Here is your problem
$x = {}; # reference to an anonymous hash
$x = sub {}; # reference to an anonymous sub
> my $ignore_action = 0;
> if ($_[1])
> {
> if ($_[1] eq 99) # looking for Attribute section
> {
> if ($_[0] =~ /^Attribute/)
> {$_[1] = 1;} # State says found first Attribute
> $ignore_action = 1; # ignore record
> }
> elsif ($_[0] =~ /^Attribute/) # found another Attribute record?
> {$ignore_action = 1;} # ignore Attribute record
> else # No attribute record, start processing
> {
> $_[1] = 0; # state says we've completed the header
> $ignore_action = 0; # accept this record
> }
> }
> $ignore_action = $ignore_action; # iron-clad final assignment
I think the optimizer will remove this "iron-clad" statement as being
useless. Why do you want it here? Just simply having $ignore_action by
itself on the last time is good enough to ensure the return code.
> };
>
> This gives me a syntax error near the first if in the anonymous subroutine.
Good. I was afraid that this compiled. Just stick in the keyword "sub"
and things should be much better.
And as a personal comment, I'd like to add that $_[1] is ugly. Start
your subroutine with something like
my ($recordtype, $attribute) = @_;
because this will let you use symbolic names with are usually easier to
remember and maintain than hard coded array offsets. Not a real
technical problem, but an important issue nevertheless.
Also, I would have started with
return 0 unless ( $attribute );
and saved a layer of indentation. IMnsHO that is easier to read.
And while I'm at it, why are you doing
$_[1] = 0;
You don't actually use this later in your subroutine. Are you trying to
modify your parameter list? Again, I think that is bad style. Side
effects and what not. I think it cleaner to return any modified
parameters so it is obvious that something has changed.
- doug
------------------------------
Date: Tue, 30 Sep 1997 12:35:29 +0200
From: Doug Seay <seay@absyss.fr>
To: Ron Yacketta <RonYak@mindspring.com>
Subject: Re: Help with system()
Message-Id: <3430D5F1.60607F83@absyss.fr>
[posted and mailed]
Ron Yacketta wrote:
>
> I have the following piece of code that works fine, except that I get
> unwanted output from the command being issued from inside the system(). I
> would like to have the command inside the system() execute without any
> output to STDOUT/STDERR.
>
> eval {$do = system '/etc/vgcfgbackup', "/dev/$_"};
> if ( $do ne 0 )
> {
> warn "\n\tFatal error!!\n\tContact the System Administrator\n\n";
> }
You don't really need this eval().
> the vgcfgbackup command spits out info to the STDOUT and or STDERR depending
> on its success/failure. I would like to run the vgcfgbackup command with NO
> output to STDOUT/STDERR and use the if() to notify the user of success or
> failure.
If you are launching a process that writes to stdout or stderr, you will
have to play games with file descriptors. There could be a CPAN module
for doing this, but if you do it yourself the basic thing is
fork()
muck with stdout and stderr
exec()
"perldoc -f open" has some examples of this sort of thing.
- doug
------------------------------
Date: Tue, 30 Sep 1997 08:51:06 GMT
From: ben@reser.org (Ben Reser)
Subject: Re: Makefile out of date...
Message-Id: <3430bd62.25992324@192.168.0.1>
Ken,
Just a suggestion don't know if it'll help but check the date on the
system that you're installing this on. I believe it it's set too far
into the past it'll cause a variety of problems during Perl
compilation.
On Mon, 29 Sep 1997 16:16:52 -0400, ken@forum.swarthmore.edu (Ken
Williams) wrote:
>Hi-
>
>I'm unsuccessfully trying to build sfio into Perl 5.004_01. Here's one of
>the errors I get:
>
> [errors removed]
>
>I get similar errors for every module that's supposed to be dynamically linked.
>
>Rerunning the make command doesn't help. This make actually produces an
>executable, but it doesn't have sfio in it.
>
>I've seen this problem posted before and the problem was that the guy's
>machine's clock was a year off! This is not what's happening on my
>system. Also, the makefile is fresh, it was just created by Configure.
>
>I'll be grateful for some enlightenment.
>
>-Ken Williams
> The Math Forum
> ken@forum.swarthmore.edu
************************* IMPORTANT *************************
Why the new email address you ask?
Simple, I'm attempting to simplify the way I filter my mail.
Please direct all personal mail to ben@reser.org
Not directing personal mail to this address may cause
delays in me reading your mail or may even get it deleted.
************************ IMPORTANT *************************
---
Ben Reser <ben@reser.org>
http://ben.reser.org
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d-(+)@ s:- a-- C++++$ UBVC++++(++)$ P+++$>++++ L- !E---- W@ N(+)>++ o? K--? w++$@>+++ !O---- !M V PS+(++)@>+++ PE++(+++)@ Y+(++)@ PGP+(++)>+++ t+()@ 5 X !R tv-(+)@>-- b+(++)>+++ DI++ D G e h++ r-()>+++ y?
------END GEEK CODE BLOCK------
------------------------------
Date: Tue, 30 Sep 1997 12:02:17 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: New Perl syntax idea
Message-Id: <3430CE29.4C6A6B23@absyss.fr>
Chris Schoenfeld wrote:
>
> Greg Bacon wrote:
> >
> > In article <342FE73B.41C2@ixlabs.com>,
> > Chris Schoenfeld <chris@ixlabs.com> writes:
> > : How about aliasing 'method' to 'sub' and passing the object reference
> > : through a magic variable when 'method' is used?
> >
> > What potential benefits do you see for such an addition?
>
> To eliminate the repetitive use of:
> my $self = shift;
>
> Whose verbosity smells unperlish.
>
> Does that make sense?
Yes and no. Perl is terse, but only because it cuts out needless fluff.
I don't see what is gained by your scheme. It reminds me too much of
the $package::AUTOLOAD variable which I think is a smashingly bad idea.
I don't see any major advantage of SmallTalk's "self" or C++'s "this" in
Perl as I kinda like the "everything you need is a parameter" idea.
I am not sure that something like this is useful, what I'd rather see
would be
sub mymethod($self$scalar@list) # perhaps with spaces
which would be the same as
sub mymethod($$@)
{
my ($self, $scalar, @list) = @_;
but this is just fluff that we don't really need.
- doug
------------------------------
Date: Tue, 30 Sep 1997 12:25:18 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <3430D38E.6D274F04@absyss.fr>
Joseph wrote:
>
> Gee, Abigail, thanks a lot.
<snippage>
> You bring narrow minded twitness to a new high. What makes you think
> I'm on a unix machine? I left the command line world behind a long
> time ago.
>
> In the future, please keep your thoughts to yourself. Thanks.
Actually, she wasn't all that nasty. I've seen worse. And since it was
fairly funny, it was better than most flames on USENET. Try to
appreciate the situation and roll with the punches.
It was wrong of her to assume that you are using Unix. Did you
understand that she used "Unix-ese" to says
look in "perlop" for "concatenate"
If you prefer to fire up some sort GUI application for this, knock
yourself out. Most of us prefer the speed and versitility of the
commandline, but to each his own.
But also please remember that starting things off with "I know this has
GOT to be the ultimate newbie question, but I don't
know perl" leaves the impression that not only do you not know Perl, you
don't don't even feel like learning it. If you had read a few docs
(such as perlop, third on the list to read) it wouldn't be the "utlimate
newbie question". People who don't bother reading the docs (shipped
free with every copy of Perl5) or FAQs (also included in the standard
distribution) annoy those of us who want to help, but are sick and tired
of being treated as servents. "Jives, please read the manual to me."
If you want to learn Perl, we'll all be glad to help you. We'll point
you in the right direction and help you over the bumpy parts, but you
have to be the one to do the work. We aren't paid to do your job.
Hell, I don't know any of us who are paid to answer questions on USENET
(if so, are there any openings there :-).
- doug
------------------------------
Date: Tue, 30 Sep 1997 08:52:59 GMT
From: ben@reser.org (Ben Reser)
Subject: Re: newbie question : crypt library
Message-Id: <3430bda7.26061864@192.168.0.1>
First of all I'm not sure why crypt wasn't installed in the first
place but just installing it isn't going to solve your problem.
Perl does lots of tests at compilation time for functions. If it
isn't there it doesn't include the code to use that and puts code in
that bascially says "This is broke". So a recompile is going to be
necessary.
On Mon, 29 Sep 1997 20:58:22 GMT, "Jean-Francois Deschenes"
<deschenj@rc.gc.ca> wrote:
>I have just started to learn perl and I was trying to create a password
>file with the crypt function. When i tried it at first it said crypt() not
>implemented. So i got the crypt library (international version) from my OS
>site (SCO). I installed it and it said installation successful, no
>problem.
>
>I now have the libcrypt_i.a file but i still have the same problem with
>perl. I guess i must add this new library to perl but I don't know how.
>Do I have to reinstall perl or can just type a command?
>
>I realize it's a very simple question but I have looked at the perl FAQ and
>have not found an answer ( maybe i did not see it ).
>
>Thank you
>
>J-F Deschenes
>deschenj@rc.gc.ca
>
************************* IMPORTANT *************************
Why the new email address you ask?
Simple, I'm attempting to simplify the way I filter my mail.
Please direct all personal mail to ben@reser.org
Not directing personal mail to this address may cause
delays in me reading your mail or may even get it deleted.
************************ IMPORTANT *************************
---
Ben Reser <ben@reser.org>
http://ben.reser.org
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d-(+)@ s:- a-- C++++$ UBVC++++(++)$ P+++$>++++ L- !E---- W@ N(+)>++ o? K--? w++$@>+++ !O---- !M V PS+(++)@>+++ PE++(+++)@ Y+(++)@ PGP+(++)>+++ t+()@ 5 X !R tv-(+)@>-- b+(++)>+++ DI++ D G e h++ r-()>+++ y?
------END GEEK CODE BLOCK------
------------------------------
Date: Tue, 30 Sep 1997 06:19:09 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Options & No Wrong Answers
Message-Id: <d7nq06.7m.ln@localhost>
April D. Melton (MELTON@PITNET.NET) wrote:
: There are 26 questions & each has four possible responses. None of the
: responses are incorrect, just different.
: Example: Rate Yourself:<SELECT name="Z26" size="1">
: <OPTION value="0">Needs Work</OPTION>
: <OPTION value="1">Fair</OPTION>
: <OPTION value="2">Good</OPTION>
: <OPTION value="3">Excellent</OPTION>
: </SELECT><INPUT type="submit"
: name="finish" value="Submit">
: At the end of the quiz, I want the script to perform two functions:
[snip]
: 2. Print to screen the option chosen for each question.
: Example: For question A, you rated yourself as "Excellent."
: How do I reconvert the numerical choice back to a text choice?
: I tried putting it into a hash but it didn't work. I think I
: probably didn't reference it correctly.
@num2text = ('Needs Work', 'Fair', 'Good', 'Excellent'); # array, not hash
print qq(For question A, you rated yourself as "$num2text[$ans]"\n);
: Does anyone have any suggestions? If so, please email me at
: melton@pitnet.net
Please read the newsgroup where you asked the question.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 30 Sep 1997 11:15:54 GMT
From: havliogc@cs.man.ac.uk (C E Havlioglu)
Subject: Perl version mismatch
Message-Id: <60qn1a$ea9$1@m1.cs.man.ac.uk>
When I try to run my scripts I get the following message:
Perl lib version (5.001) doesn't match executable version (5.004)
What should I do to have my scripts match the current
executable version?
Cheers
Cuneyt
--
_______________________
__/ Cuneyt Emre HAVLIOGLU \________________________
The University of Manchester
Department of Computer Science, ACS
e-mail: havliogc@cs.man.ac.uk
___________________________________________________
------------------------------
Date: 30 Sep 1997 11:38:54 GMT
From: havliogc@cs.man.ac.uk (C E Havlioglu)
Subject: Perl version mismatch: SORTED
Message-Id: <60qoce$evg$1@m1.cs.man.ac.uk>
Hi,
Please ignore my previous post with the subject line
`Perl version mismatch'
because the problem is solved. (I don't know how ?:-(?)
Cuneyt
--
_______________________
__/ Cuneyt Emre HAVLIOGLU \________________________
The University of Manchester
Department of Computer Science, ACS
e-mail: havliogc@cs.man.ac.uk
___________________________________________________
------------------------------
Date: Tue, 30 Sep 1997 13:17:29 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Perl4 is *not* Y2K (was Re: Y2K)
Message-Id: <3430DFC9.6D4FEDAE@absyss.fr>
Kevin Connery wrote:
>
> Agreed. But that doesn't make it _dead_, either. A 1940's automobile
> can still navigate the road effectively, even though it's not competitive,
> nor as safe as the modern vehicles. *If used in the proper places*, it's
> a reasonable alternative.
>
> (Such reasonable places are for in-house use, where the costs of
> upgrading [time], while low, are exceeded by the benefit: i.e., none
> of the _current_ sysadmins know perl, but there's a large body of
> existing scripts from previous ones. Even the minor switch and
> occasional/rare syntax change would cost time.
Yes and no. Sure, "why change" is a common arguement and I understand
it, but it doesn't mean that I think that using inferior products is a
good idea. And in this case it means that your sysadmins are using
unsupported tools that they cannot fix. This should be a red flag, but
it is also not the point at hand.
> Now, for _new_ development, or _web_ or _cgi_, sure, Perl5 is the
> best choice--the cost of doing it otherwise is extremely high compared
> to using a set of modules. That doesn't make it unusable, or unsafe in
> other environments.
>
> >PS - I think you mean "objects" not "structures". Hashes haven't
> >changed in any way that I can remember.
>
> Nope. "Structures": using references [scalars] in hashes or arrays
> gives structure-like capabilities not available in v4. (Objects, too,
> but I've not gotten that far myself.)
I thought you ment C style fields_in_a_variable type structures. You
could use typeglobs and eval() to do some of this in perl4, but it would
be ugly, painful and a bad idea to even try.
Also, why does the list of neeto-new things with Perl5 never include
"my" variables? Do most people not see that they are fundamentally
different than "local" variables?
- doug
------------------------------
Date: Tue, 30 Sep 1997 08:56:03 GMT
From: ben@reser.org (Ben Reser)
Subject: Re: Recursive object reader
Message-Id: <3430be5e.26244888@192.168.0.1>
Umm why don't you just use the Unix find command?
And if you aren't on Unix try looking into the File::Find module.
On Tue, 30 Sep 1997 03:53:33 +0100, Mark Worsdall
<jaydee@worsdall.demon.co.uk> wrote:
>Hi,
>
>Has anyone got a perl script that will recurse through a directory
>structure reading and displaying file objects last modifed date?
>
>I would be grateful for an example.
>--
>Mark Worsdall - Oh no, I've run out of underpants :(
>Home:- jaydee@worsdall.demon.co.uk WEB site:- http://www.worsdall.demon.co.uk
>Shadow:- webmaster@shadow.org.uk WEB site:- http://www.shadow.org.uk
************************* IMPORTANT *************************
Why the new email address you ask?
Simple, I'm attempting to simplify the way I filter my mail.
Please direct all personal mail to ben@reser.org
Not directing personal mail to this address may cause
delays in me reading your mail or may even get it deleted.
************************ IMPORTANT *************************
---
Ben Reser <ben@reser.org>
http://ben.reser.org
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d-(+)@ s:- a-- C++++$ UBVC++++(++)$ P+++$>++++ L- !E---- W@ N(+)>++ o? K--? w++$@>+++ !O---- !M V PS+(++)@>+++ PE++(+++)@ Y+(++)@ PGP+(++)>+++ t+()@ 5 X !R tv-(+)@>-- b+(++)>+++ DI++ D G e h++ r-()>+++ y?
------END GEEK CODE BLOCK------
------------------------------
Date: Tue, 30 Sep 1997 08:48:55 GMT
From: ben@reser.org (Ben Reser)
Subject: Re: Test for alphabetic character?
Message-Id: <3430bc8d.25779138@192.168.0.1>
This is a FAQ:
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_do_I_determine_whether_a_sca
On Mon, 29 Sep 1997 15:53:06 -0400, "Ramon Rodriguez"
<ramonr@earthlink.net> wrote:
>How can I test to see if some user input in a cgi script is text or
>numeric(what I'll accept) in Perl5? Thanks in advance.
>
>
>Ramon Rodriguez
>
>
************************* IMPORTANT *************************
Why the new email address you ask?
Simple, I'm attempting to simplify the way I filter my mail.
Please direct all personal mail to ben@reser.org
Not directing personal mail to this address may cause
delays in me reading your mail or may even get it deleted.
************************ IMPORTANT *************************
---
Ben Reser <ben@reser.org>
http://ben.reser.org
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d-(+)@ s:- a-- C++++$ UBVC++++(++)$ P+++$>++++ L- !E---- W@ N(+)>++ o? K--? w++$@>+++ !O---- !M V PS+(++)@>+++ PE++(+++)@ Y+(++)@ PGP+(++)>+++ t+()@ 5 X !R tv-(+)@>-- b+(++)>+++ DI++ D G e h++ r-()>+++ y?
------END GEEK CODE BLOCK------
------------------------------
Date: 30 Sep 1997 13:20:51 +0300
From: matti@universe.pc.helsinki.fi (Matti Kinnunen)
Subject: Re: What does the . operator do?
Message-Id: <lz67rjje64.fsf@universe.pc.helsinki.fi>
In article <342848AD.12C7543F@wvecomputers.net> Nate <nate@wvecomputers.net> writes:
what exactly does the . operator do.. for instance:
$data{'new_item'} .="; " if $data{'new_item'};
****
Adds "; " to $data{'new_item'} if $data{'new_item'} is true ( has non-zero, non-empty
value ).
Thus . concatenates strings.
--
* matti.kinnunen@helsinki.fi *
* http://universe.pc.helsinki.fi/~matti/contact.html *
* +358-(0)40-593 50 91 but try first +358-(0)9-191 23978 *
------------------------------
Date: Tue, 30 Sep 1997 10:50:19 +0100
From: toad@hem1.passagen.se (Toad)
Subject: Re: XS
Message-Id: <MPG.e9ae9ca8bd79ea5989684@nntpserver.swip.net>
I've actually managed to create a simple XSUB, wow! But now I have some
problems with the typemaps... I'm using a fairly complex struct in my C
funcs, something like this;
struct {
rclist* data;
int status;
char* error;
}
where rclist is a sort of linked list. How do i handle this the best way?
tips please....
/Patrik Lernell
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 1103
**************************************