[12095] in Perl-Users-Digest
Perl-Users Digest, Issue: 5695 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 17 10:07:17 1999
Date: Mon, 17 May 99 07:00:17 -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 Mon, 17 May 1999 Volume: 8 Number: 5695
Today's topics:
Controlling modem in Perl taggor@yahoo.com
Embperl?! <div@kabkonsult.se>
Re: Getchar or Keypress ? (Tad McClellan)
Re: help, A Simple Question <vvb@ibm.net>
How to convert flat file database to dbm databases (Michael Wang)
Multi character quotes (jon ewing)
No classes.zip file found <NorthernSnow@worldnet.att.net>
Re: Oraperl question (newbie) <cschmitz@stud.informatik.uni-trier.de>
Re: Perl "constructors" <rra@stanford.edu>
Re: Perl "constructors" <rra@stanford.edu>
Re: Perl "constructors" <dms@rtp-bosch.com>
Re: Perl "constructors" (Sam Holden)
Re: Perl "constructors" (Sam Holden)
Re: Perl "constructors" <jdporter@min.net>
Re: Perl "constructors" <jdporter@min.net>
Re: Perl "constructors" <jdporter@my-dejanews.com>
Problem with CGI.pm need an example smnayeem@my-dejanews.com
Re: Problem with CGI.pm need an example <clint@drtech.co.uk>
Re: use array as keys in a hash <jdf@pobox.com>
Re: Using Apple's Sherlock plugins from perl (Chris Nandor)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 17 May 1999 13:42:41 GMT
From: taggor@yahoo.com
Subject: Controlling modem in Perl
Message-Id: <7hp6ch$e1j$1@nnrp1.deja.com>
Is there a module or a way to talk to the modem through a Perl script.
I am on a IBM RS/6000 machine with AIX. The perl version I'm using is
5.004. What I want to ultimately do is dial a number, let it ring 3
times then disconnect.
Chuck Rickard
taggor@yahoo.com
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Mon, 17 May 1999 13:19:58 GMT
From: "B Rasmusson" <div@kabkonsult.se>
Subject: Embperl?!
Message-Id: <2IU%2.324$cWi.186519040@newsb.telia.net>
Hello!
I have read a little about Embperl and it sounds interesting.Before I go
into it further I have a question.
Is it possible to use Embperl to create dynamic pages (on a Linux-server),
i.e when a user wants to get a certain page, a template are in the
background and on the fly filled with certain information picked from a
database? E.g. bookpresentations where all pages looks the the same, except
as for titles, information, prices etc. Something like what could be done
with ASP on a NT-server.
Bengt
------------------------------
Date: Mon, 17 May 1999 02:57:54 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Getchar or Keypress ?
Message-Id: <ileoh7.fu6.ln@magna.metronet.com>
KRyZ (kryz@evc.net) wrote:
: anyone know how to read directly a char from the keyboard and get his value
: ? (i don't want to press the enter key ...)
: If you have a small exemple ... please mail it me ... thanx
Perl FAQ, part 5:
"How can I read a single character from a file? From the keyboard?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 17 May 1999 13:52:36 +0200
From: "Vincent Vanbiervliet" <vvb@ibm.net>
Subject: Re: help, A Simple Question
Message-Id: <373ff3b0@news.uk.ibm.net>
dickyart <dickyart@hkstar.com> wrote in message
news:373FD758.A94574AA@hkstar.com...
> I am beginner of Perl
> Please help me
>
> -------------------------------
> $B=(10,9,8,7,6,5,4,3,2,1,'BOOM');
> @A=$B;
Sam's suggestion is the best, but if you want to use $B (a scalar), and
convert it into an array, you could use:
@A=split /,/, $B;
Vincent
------------------------------
Date: 17 May 1999 12:34:23 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: How to convert flat file database to dbm databases
Message-Id: <7hp2cf$co6$1@news.ml.com>
I have the flat file database for people's beeper numbers and email
addresses:
user:bill:12345678:Bill Lee:bill@mycom.com
user:jim:98765411:Jim Kelly:jim@mycom.com
user:charlie:9875670:Charlie Dee:charlie@mycom.com
alias:support:bill,jim:System Support:support@mycom.com
alias:all:charlie,support:All People:all@mycom.com
Current I simply search the "key", and if it is a "user key",
then I simply get the "values": beeperid and email address,
and then send page or/and email according to options. And if it is
an "alias key", then I further expand the value to beeperid's.
This is done in Perl.
As the file grow, performance is an issue. So I would like to convert
to dbm and change the program accordingly. What is the best way to
do this? "dbm" files contain only a pair. So I have to create
three user dbm databases, and three alias dbm databases like:
user -> Beeperid
user -> Real Name
user -> Email
alias -> Beeperid
alias -> Real Name
alias -> Email
Then I query different databases to have everything resolved? If this
what I need to do, what is the tool that I can use. I find that
makedbm in Solaris deos not work with dbm_fetch as shown below:
#include <ndbm.h>
#include <stdio.h>
#include <fcntl.h>
#define NAME "a"
#define DB_NAME "db"
main()
{
DBM *db;
datum name = {NAME, sizeof (NAME)};
datum val;
db = dbm_open(DB_NAME, O_RDONLY, 0600);
val = dbm_fetch(db, name);
(void) printf("Name: %s, Value: %s\n", name.dptr, val.dptr);
dbm_close(db);
return (0);
}
[pizza:/export/home/root/C]gcc query_dbm.c
[pizza:/export/home/root/C]echo a b | makedbm - db
[pizza:/export/home/root/C]./a.out
Segmentation Fault(coredump)
--
Michael Wang
http://www.mindspring.com/~mwang
------------------------------
Date: 17 May 1999 06:35:08 -0500
From: jon@webdev.co.uk (jon ewing)
Subject: Multi character quotes
Message-Id: <373ffdd8.12530057@news1.newscene.com>
Hi,
Is it possible to use q, qq, qw etc with delimiters of more than one
character? Or is there another way (ie not using q, qq, qw etc) to do
this?
ta
jon.
------------------------------
Date: Mon, 17 May 1999 09:08:47 -0400
From: "Frank Siegel" <NorthernSnow@worldnet.att.net>
Subject: No classes.zip file found
Message-Id: <7hp4fg$2no$1@bgtnsc02.worldnet.att.net>
I recently installed Java1.2.1 and do not have a classes.zip
file on my system. I was expecting to see it in c:\jdk1.2.1\lib
directory but it's not. I want to set my CLASSPATH statement
in autoexec.bat.
My java program compiles correctly but does not run. I get a
"class not found" error message even though my current
directory is where the class is. I'm running win95.
I've been advised to use -classpath in my javac and java
commands but I'm missing the classes.zip file.
Thanks for your help.
Frank S.
New Hampshire
------------------------------
Date: 17 May 1999 13:10:51 GMT
From: Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de>
Subject: Re: Oraperl question (newbie)
Message-Id: <7hp4gr$vf$1@fu-berlin.de>
Jared Hecker <jared@pandora.planet.net> wrote:
: I have the latest Oracle DBD installed, along with the latest perl
: release. I have been reviewing the 'commit.pl' example script included
: with the DBD distribution and wondered how one inserts multiple records
: into a table out of an array. Does one set up a small loop and do it one
: record at a time? That would be inefficient, and doesn't seem a perl-ish
: approach to me.
Hi Jared,
perhaps you want to have a look at the DBIx::Recordset module.
-- quote from the docs --
You can access (read and write) the database (or a selected subset) as an
array or you can access it as a hash, where the hashkey is the primary key
of the databasetable.
-------------------------
DBIx::Recordset is available from CPAN. I don't know about efficiency
aspects, though.
HTH,
Christoph
--
-- Christoph Schmitz <cschmitz(at)stud.informatik.uni-trier.de> --
Beware of bugs in the above code; I have only proved it correct, not tried
it. -- Donald E. Knuth
------------------------------
Date: 17 May 1999 04:32:23 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl "constructors"
Message-Id: <ylk8u8vsmw.fsf@windlord.stanford.edu>
armchair <armchair@my-dejanews.com> writes:
> I don't see why you feel you can leave off the fact that a Perl object
> is also the instantiation of a package/module definition (in turn a
> reference on steroids).
Because Perl doesn't have that concept, or at least doesn't require it.
An object *isn't* necessarily the instantiation of some package; packages
don't have to have anything to do with objects at all and vice versa.
> what do you call the thing on the left below
> my ($field1, $field2, $field3, $field4) = unpack("i5",$my_data);
> Looks like an anonymous record, no?
Er, no. It looks like four completely independent variables. Or
optionally a list, depending on what level you're looking at things at.
> And with no records, shouldn't localtime() actually fill what has been
> referred to as Perl's record - a hash?
No, localtime returns completely independent values. There's no record
involved, just a list.
> Before Perl had objects, was the doctrine that you don't need them, and
> that anyone suggesting as much was simply Not Getting It? Or more
> generally, has their ever been a time when a feature was asked for in
> Perl, and the doctrine was against it, and it was later added to the
> language?
Sure, lots of times. I think it's great for people to propose that things
be added to Perl. But any such proposal, even if it comes from someone
who knows a *lot* about Perl at every level and has a long reputation for
adding very important and significant things to Perl, will undergo very
intense scrutiny. (Ask Ilya about weak refs, for example.) This is
largely because Perl is a very mature language, with a huge existing
installed base and a cultural understanding of how things are done in
Perl. And because Perl is a very complex language, meaning that any
proposal to change it has to deal with a lot of unexpected side effects.
> It still has to be dereferenced, before it can be manipulated as an
> array.
Sure, and you have to dereference "this" before you can use it as a
struct. No difference there.
> And arrays inside C classes/structs can be manipulated as an external
> array, once it is "derefererenced" by adding the objectname. to the
> array name.
No, you have to dereference it *twice*. First by either dereferencing the
pointer to your object or by using struct notation to talk about the field
inside the object, and then by dereferencing the array itself.
This is exactly the same as a Perl object consisting of a reference to a
hash, which contains an array. $obj->{array}[4] is the fourth element of
that array. In C++, this is obj->array[4]. Exactly the same except for
{}, which is just Perl's syntactic way of doing something like structs in
C++.
What *Perl* lets you do is have an object that's a reference to an array
instead of a hash. That lets you say $obj->[4], which is the fourth
element of an array which is also an object. You cannot say (*obj)[4] in
C++ if obj is a pointer to an object, or obj[4] if obj is an object. It
won't even compile.
> I disagree. Just as you have to dereference the Perl object to get at
> the array, as I wrote previously: push(@$my_object,1); you also can do
> anything with the array inside a C++ object once you "dereference it".
> push(my_object.array,1);
That's not dereferencing it. That's talking about a variable stored
inside the object, not talking about the object itself. That Perl
statement and that C++ statement do utterly different things.
The C++ statement is the equivalent of push (@{$my_object->{array}}, 1),
almost. In fact, you're simplifying things here a little because C++
doesn't have real arrays, only pointers to areas of memory. The
additional @{} needed in Perl is because Perl has real arrays, and push
expects to take one. If you have a Perl sub that acts like your push()
C++ function would have to, you could just say:
push_ref ($my_object->{array}, 1);
which looks a *lot* like your C++ example. Perl just uses more characters
for these things.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 17 May 1999 04:35:05 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl "constructors"
Message-Id: <ylhfpcvsie.fsf@windlord.stanford.edu>
Russ Allbery <rra@stanford.edu> writes:
> What *Perl* lets you do is have an object that's a reference to an array
> instead of a hash. That lets you say $obj->[4], which is the fourth
> element of an array which is also an object. You cannot say (*obj)[4]
> in C++ if obj is a pointer to an object, or obj[4] if obj is an object.
> It won't even compile.
I should add here "unless you've overloaded the [] operator, in which case
you can get a bit closer to an approximation of what Perl does, but you
still can't use the object quite completely like an array and you end up
with lots of action-at-a-distance problems because it's not obvious what
[] is going to do." But I covered that in an earlier post.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 17 May 1999 07:43:35 -0400
From: Doug Seay <dms@rtp-bosch.com>
Subject: Re: Perl "constructors"
Message-Id: <374000E7.CF733FBF@rtp-bosch.com>
Michael Stillwell wrote:
>
> According to my benchmarks, you take about a 20% performance hit doing
> records with a hash though.
Yes, arrays are slightly faster than hashes, but who cares? In a
non-trivial program, I doubt if that 20% will add any real slowdown. If
you have to worry about that sort of detail for run time performance, I
think you should consider C for some/all of your application.
> I guess you can improve things with #defines:
No. Why import a C concept to Perl? Has constant.pm gone out of style?
use constant X => 0;
use constant Y => 1;
> But I haven't seen any code that does this. Is this because it makes
> inheritance hard?
Yes. If you add something new to the parent, the kiddies have to be
updated. You would need to do something like
use constant X => 0;
use constant Y => X + 1;
And multiple inheritance becomes *really* tricky. But like many things
in Perl, you can do it. If you are sure that this won't come back to
haunt you, go ahead.
Hashes might not be the most elegant (read: Ivory Tower) way of handling
this, but they work well for most things.
- doug
------------------------------
Date: 17 May 1999 11:48:38 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl "constructors"
Message-Id: <slrn7k00gm.ace.sholden@pgrad.cs.usyd.edu.au>
On 17 May 1999 04:32:23 -0700, Russ Allbery <rra@stanford.edu> wrote:
<snip...>
>What *Perl* lets you do is have an object that's a reference to an array
>instead of a hash. That lets you say $obj->[4], which is the fourth
>element of an array which is also an object. You cannot say (*obj)[4] in
>C++ if obj is a pointer to an object, or obj[4] if obj is an object. It
>won't even compile.
Well you could but you would need to write operator[](int) first (or is
it operator[](size_t)???) . Of course it would then mean a completely
different thing.
--
Sam
Many modern computer languages aspire to be minimalistic. They either
succeed in being minimalistic, in which case they're relatively useless,
or they don't succeed in being truly minimalistic, in which case you can
actually solve real problems with them. --Larry Wall
------------------------------
Date: 17 May 1999 11:49:16 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl "constructors"
Message-Id: <slrn7k00hs.ace.sholden@pgrad.cs.usyd.edu.au>
On 17 May 1999 04:35:05 -0700, Russ Allbery <rra@stanford.edu> wrote:
>I should add here "unless you've overloaded the [] operator, in which case
Damn I just mentioned that...
--
Sam
PC's are backwards ... throw them out! Linux is ok though.
--Rob Pike (on the subject of CR/LF etc)
------------------------------
Date: Mon, 17 May 1999 12:35:54 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7hp2fa$bj9$1@nnrp1.deja.com>
In article <7hippv$8j0$1@nnrp1.deja.com>,
armchair@my-dejanews.com wrote:
> Why don't you just make your case in this forum.
It is my opinion that those documents speak to the issues as clearly
as I could, and anything I say would essentially be redundant.
But since it's an argument you want...
> I have read those
> documents and did not reach the same conclusion you have.
The point of perlobj is not to convince you that The Right Way is
The Perl Way, but rather, to educate you on what the Perl way is.
If your biases can't let you accept that the Perl way works, then
you better just stick with what you know. That's OK. Many people
do that.
> Perl would not
> have to be C++ to have a fixed name for constructors.
As I understand it, what you are proposing is that perl disallow
any method from returning a blessed lexical except those whose
name is in some special set (i.e. either 'new', or the final
element of the class path name* -- you haven't said which).
But this is a bogus restriction that makes life worse for Perl
programmers while adding nothing of any benefit to anyone else.
> And since C++ is
> used for major projects, whereas Perl is used on more "quick and
dirty"
> small projects, I am very surprised that you would feel that the Perl
> way is the right way.
"Right" is only meaningful in context. When you're programming
in Perl, the Perl way *is* the right way. At least, "more right" than
the way of some alien language.
The size of the projects on which Perl is used is irrelevant.
> It is much easier to work with discrete variables rather than
> subscripted array variables. I can remember that total_attendees is
the
> number of peope who attended the meeting a lot easier than I can
> $rSelf->[10] is.
Apparently you're not familiar with the (far more common) hash
object style: $rSelf->{'total_attendees'}.
> I have not run into any brick wall,
Then your argument is merely academic.
Perl doesn't respect academic arguments.
Perl gets real work done in the real world.
That its design philosophy! Perl is Practical.
> but having worked
> with C++, I can assure you that having only one reference in an object
> point to its data (none of which is a struct or true multi-dimensional
> array) does not lead to a great convenience in programming.
As a professional Perl programmer, I can assure you that it does
indeed lead to great convenience. Based on my own personal
experiences. This carries rather more weight with me that your
"assurances", which seem to be based on nothing more than some
familiarity with a kludgy half-baked OOPL wannabe. Not that Perl
is Smalltalk or Eiffel, but C++ isn't either. You need to get past
the biases you bring from other languages, and understand Perl
for what it is. The similarity of the syntax is misleading; Perl
is really nothing like C++, and any expectations that it is are
bound to lead to frustration.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
* E.g.
package Grommet::Aglet::Terlet;
sub Terlet { bless { }; }
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Mon, 17 May 1999 12:57:15 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7hp3nc$cdb$1@nnrp1.deja.com>
In article <7hjhv6$r17$1@nnrp1.deja.com>,
armchair@my-dejanews.com wrote:
> Would I be correct in surmising that the
> slogan of this newsgroup is not "everybody join in".
Sure, Everybody join in! It's a free-for-all in clpm, as you
will soon learn, if you haven't already.
Even so, the invitation to Perl itself is a standing one.
You should not be discouraged from learning Perl based on the
reception you get in this unruly newsgroup.
> The "one reference per object" is only a minor complaint.
This shouldn't be any complaint at all. References are like
pointers -- to use the closest C++ analogy. If you say
p = new Foo; // get pointer to new instance.
you certainly don't expect p to contain anything other than a
pointer. If the "object" needs to have other stuff (and of course
it would consist of something other than a pointer to itself), you put
that stuff into the structure being pointed to. It's the same way
with references in Perl. You can't do pointer arithmetic with
Perl references, but apart from that, there's little difference*.
> My major complaint ... is that one variable can at one
> moment hold a number, and another moment hold a string (not to mention
> references).
In fact, it can hold all of these things *at the same time*.
The "Scalar Values" section of perldata explains why.
> And I am trying to learn Perl, but have run into some mixed opinions
on
> whether or not I am doing the right thing...
If you're really trying to learn Perl, you're doing the right thing.
But you need to let Perl be itself, not try to shoe-horn it into
some preconceived notions about what a language should be.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
*Oversimplifying, of course.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Mon, 17 May 1999 13:31:48 GMT
From: John Porter <jdporter@my-dejanews.com>
Subject: Re: Perl "constructors"
Message-Id: <7hp5o4$dko$1@nnrp1.deja.com>
In article <7hlu8v$bl9$1@nnrp1.deja.com>,
armchair@my-dejanews.com wrote:
> Maybe agreement isn't the right word, but I certainly have gotten lots
> of positive feedback.
Really? The most positive thing I could say about your unwarranted
complaints about Perl is: you do well to think critically about the
design of the language, but eventually you'll see why the decisions
were made the way they were.
> > my $self = {};
> > $self->{ref1} = { foo => 10, bar => 20 };
> > $self->{ref2} = { this => 10, that => 20 };
>
> That is one reference per object. $self. I am aware that you can have
> that reference point to a data structure, which in turn can hold
> references to other data structures.
And how is this different from C++ exactly?
(Answer: It's not.
p = new SomeStruct;
p->ptr1 = new Foo( 10, 20 );
p->ptr2 = new That( 10, 20 );
> My major complaint ... is that one variable can at one
> moment hold a number, and another moment hold a string (not to
> mention references).
It helps to think of all scalars as being strings, with built-in
automatic conversion operators to/from other types. (That's not really
the way it is under the hood, but for now, it's a workable analogy.)
Maybe you don't relish the idea of all your numbers being stored
as strings, and getting converted -- a costly operation -- to an
integer or float each time you use it. That's why Perl caches the
result of the conversion. And this cached conversion works both
ways:
$n = $x + 5; # a number
print $n; # convert to string
$s = "$n zots"; # use the cached string value again
As far as buying the programmer something: the mere fact that I don't
have to worry about different types of scalar values is one load
off my mind. I never have to worry about different numeric
representations (single, double, short, long...), nor about string
memory allocations and overruns. From the Perl perspective, the
distinction between these different types of scalars is artificial
and unnecessary.
> "One of the ideas I keep stressing in the design of Perl is
> that things that ARE different should LOOK different."
It's all in how you understand the work "LOOK".
You can't do this and expect sensible results:
$n = 5; # a number
$n->(); # deref as a function reference?
You can't even do this:
$r = [ 5, 9 ]; # an array ref
$r->{'foo'}; # deref as a hash reference?
perl (the interpreter) is far more concerned with the types of the
*values* than the types of any things which hold values.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Mon, 17 May 1999 10:58:44 GMT
From: smnayeem@my-dejanews.com
Subject: Problem with CGI.pm need an example
Message-Id: <7hosp4$7u8$1@nnrp1.deja.com>
does anyone have an example of the correct way of using the label and
the values for say a radio group?
heres my cgi script but its not giving the desired output.
#!g:/perl/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use CGI;
$query = new CGI;
print $query->header;
print $query->start_html("Agni Billing System");
print_prompt($query);
print $query->end_html;
exit;
## Subroutines ##
sub print_prompt {
my ($query) = @_;
print $query->start_multipart_form;
%labels = ('male'=>'m','female'=>'f');
print
"Login ",
$query->textfield(-name => 'LOGIN', -size => 10),"<BR>",
"User name ",
$query->textfield(-name => 'USERNAME', -size => 25),"<BR>",
"Sex",
$query->radio_group(-name => 'SEX', -values => ['m','f'],
-default => 'm', -label=>\%labels);
print $query->checkbox(-name=>'checkbox_name',
-checked=>'checked',
-value=>'ON',
-label=>'CLICK ME');
}
if i run the above script the SEX radio group field should be displaying
male and female and internally storing m or f. however its displaying m
and f. anyone knows where i went wrong?
please help me on this :)
thanks
smnayeem
smnayeem@agni.com
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Mon, 17 May 1999 13:52:50 +0100
From: "Clinton Gormley" <clint@drtech.co.uk>
Subject: Re: Problem with CGI.pm need an example
Message-Id: <7hp3ff$qci$1@taliesin.netcom.net.uk>
> %labels = ('male'=>'m','female'=>'f');
That's your problem
It should be %labels = ('m'=>'male','f'=>'female');
Clint
------------------------------
Date: 17 May 1999 08:43:56 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "Jim Bell" <jbell@263.net>
Subject: Re: use array as keys in a hash
Message-Id: <m3iu9ruar7.fsf@joshua.panix.com>
"Jim Bell" <jbell@263.net> writes:
> # so now, can I do something like this in order to print all %ha?
> print $ha{@a};
> # I know this one doesn't work, but is there something similar
> # which can do the job with a line?
See the perldata document with regard to slices.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Mon, 17 May 1999 12:15:06 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Using Apple's Sherlock plugins from perl
Message-Id: <pudge-1705990815090001@192.168.0.77>
In article <7hl302$ps2$1@nnrp1.deja.com>, mrowell@my-dejanews.com wrote:
# I would like to be able use Apple's Sherlock plugins to conduct searches
# of the major internet search engines from within perl.
# I think that it would not be to hard to interpet the sherlock plugins
# with perl, but as I am fairly new to perl I'm not sure if anybody else
# would have already done this already. (is there any standard way to find
# out - I've searched the newsgroups & CPAN already)
# And if nobody has I think I shall take it on as project to get a good
# handle on perl.
I have several ways of talking directly to the Sherlock app from MacPerl,
using Apple events. In many ways, this would be much faster than parsing
the Sherlock plugins yourself, because Sherlock is threaded. Parsing the
plugins should not be too difficult, though. It is a pretty basic markup.
My Mac::Glue stuff (in alpha, and being redesigned) is good for accessing
Sherlock. Before my redesign, I was able to do stuff like:
#!perl -wl
use Mac::Glue::Sherlock;
$s = new Mac::Glue::Sherlock;
@hits = $s->search_Internet(['Yahoo!', 'AltaVista'],
{'for' => 'pudge.net', display => 0})->get;
$s->quit;
print join "\n", @hits;
The next version will likely be similar, except that the constructor will
be more like:
use Mac::Glue;
$s = Mac::Glue->new('Sherlock');
Anyway, there are ways to do it now, too, with raw Apple events or AppleScript.
Feel free to join the macperl-modules list for more discussion on
Mac::Glue or Apple events, or the macperl list for more discussion on
MacPerl in general.
http://www.macperl.org/
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
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 5695
**************************************