[29297] in Perl-Users-Digest
Perl-Users Digest, Issue: 541 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 20 14:19:15 2007
Date: Wed, 20 Jun 2007 11:19:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 20 Jun 2007 Volume: 11 Number: 541
Today's topics:
Re: How can I use the string variable expansion for OO <rvtol+news@isolution.nl>
How to set value to radio button with mechanze.pl <tristan@vvv.xls>
Re: lightweight access to large data structures? <nospam-abuse@ilyaz.org>
looking to prototype a grammar need suggestions. <bpatton@ti.com>
Re: package filename mismatches ? <uri@stemsystems.com>
Re: package filename mismatches ? <mritty@gmail.com>
Re: package filename mismatches ? <uri@stemsystems.com>
Re: package filename mismatches ? <uri@stemsystems.com>
Re: Passing hash to another script via commandline <jurgenex@hotmail.com>
Re: Reference syntax tim_milstead@yahoo.co.uk
Re: Reference syntax tim_milstead@yahoo.co.uk
Re: Reference syntax <jurgenex@hotmail.com>
Rose Perl Reverse engg problems : Bad File Name ebandook@gmail.com
Re: The Modernization of Emacs <kaldrenon@gmail.com>
Re: The Modernization of Emacs <dak@gnu.org>
Re: The Modernization of Emacs <kaldrenon@gmail.com>
Re: The Modernization of Emacs <borud-news@borud.no>
Re: The Modernization of Emacs (Joel J. Adamson)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 20 Jun 2007 10:56:58 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: How can I use the string variable expansion for OO "$self->attribute"
Message-Id: <f5b1db.pc.1@news.isolution.nl>
Ilias Lazaridis schreef:
> So, it seems if I want to have somethin other like
>
> return sprintf "%s: %s", $self->label, $self->val($attrib);
>
> that I have to code myself something like e.g.:
>
> return sip "$self->label: $self->val($attrib)";
See also `perldoc overload`.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 20 Jun 2007 16:39:08 +0200
From: "Tristan" <tristan@vvv.xls>
Subject: How to set value to radio button with mechanze.pl
Message-Id: <f5be6h$5u6$1@ss408.t-com.hr>
How to set value to radio button with mechanze.pl
I have group radio button
Group name is " Type"
And two buttons are:
1.) Private
2.) Pro
How to select one of button?
Is it possible with do this with mechanize?
Thanks.
------------------------------
Date: Wed, 20 Jun 2007 17:49:43 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: lightweight access to large data structures?
Message-Id: <f5bpbn$2pn3$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
<xhoster@gmail.com>], who wrote in article <20070619181927.345$gX@newsreader.com>:
> > > That may be the minimal amount of space that Perl is capable of
> > > allocating, but that does mean it is not the minimal amount of space
> > > that Perl actually does allocate in any given circumstance.
> >
> > This does not even parse.
>
> Misplaced "not".
>
> That may be the minimal amount of space that Perl is capable of
> allocating, but that does not mean it is the minimal amount of space
> that Perl actually does allocate in any given circumstance.
Now it parses. And is BS.
(As I said) there is one circumstance where one can know *exactly*
what happens. Perl's malloc() uses EXACTLY 4-byte (or 8-bytes, on
64-bit compiles) areas for small allocations (up to 4/8 bytes). Well,
there is some overhead, about 1byte per allocation; so about 400 small
allocations will use a 2K-arena.
Hope this helps,
Ilya
------------------------------
Date: Wed, 20 Jun 2007 07:44:22 -0700
From: bpatton <bpatton@ti.com>
Subject: looking to prototype a grammar need suggestions.
Message-Id: <1182350662.359129.311650@m36g2000hse.googlegroups.com>
I do regression testing for rule sets of IC layout verification.
The current rule sets are written in a doc file in complete free form
and useless to try and parse. Different people say the same thing in
different words.
I'm looking to create a prototype grammar for describing the rules.
The majority will be very simple, others will be quite complex and
contain many pseudo layers. Here's a couple of examples and some
explanation
CONT size = 100 x 100
MET1 overlap CONT = 50
BOGUS = CONT common to MET1 <-- psuedo layer created from the "and"
of 2 other layers that may or may not be pseudo layers
I've already done some data generation on by simply calling a routine
sub common(layer1,layer2,width,height) {
draw something
}
This is simple and too limited. At the very bottom this routine will
have to exist, it's the calling of this routine. making the decisions
on which routines to call and in what order. I've considered CLIPS
but the problem still exists, no matter what language or platform.
How to describe a rule in a strict grammer so that a computer language
can break it apart and act upon the grammar according to the order and
specific words.
I'm thinking that I need to have a list of
Noun -> layer and pseudo layer names (CONT,MET1,BOGUS)
verb -> denotes an action ( overlap, extends into,
touching ,...)
adjective -> to modify a noun or pronoun
pronoun -> substitutes for a noun or noun phrase with or without a
determiner, such as you and they
The idea is to supply a set of values for each of the 4 grammar
categories and use only these to describe the rules.
The nouns are the only section that is eligible to grow by the rule
coder.
>From this controlled grammar, I would then generate layout data to the
specifications of the grammer
------------------------------
Date: Wed, 20 Jun 2007 16:16:45 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: package filename mismatches ?
Message-Id: <x7vedi38k2.fsf@mail.sysarch.com>
>>>>> "PL" == Paul Lalli <mritty@gmail.com> writes:
PL> I agree with Uri that the real solution is just to train yourself
PL> better, but I think you might be able to do something with the sybmol
PL> table, like:
PL> sub my_use {
PL> my $pack = shift;
PL> require "$pack.pm";
that is a bug. what if the package name had :: in it? require only
handles :: in barewords. an expression arg for require has to have the
file path with / (or the local separator) instead of ::. this is where
the eval "require $pack" trick is useful.
PL> import $pack;
and you should know better about indirect method calls! :)
$pack->import() ;
but that is useless if called at runtime as it won't import the symbols
until too late. i told the OP about this problem too.
PL> I'm sure that's rife with bugs and won't work in all situations, but
PL> it might get you started at least?
well you are correct there! :)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 20 Jun 2007 09:38:46 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: package filename mismatches ?
Message-Id: <1182357526.250441.204070@c77g2000hse.googlegroups.com>
On Jun 20, 12:16 pm, Uri Guttman <u...@stemsystems.com> wrote:
> >>>>> "PL" == Paul Lalli <mri...@gmail.com> writes:
>
> PL> I agree with Uri that the real solution is just to
> PL> train yourself better, but I think you might be able
> PL> to do something with the sybmol table, like:
> PL> sub my_use {
> PL> my $pack = shift;
> PL> require "$pack.pm";
>
> that is a bug. what if the package name had :: in it? require
> only handles :: in barewords. an expression arg for require
> has to have the file path with / (or the local separator)
> instead of ::. this is where the eval "require $pack" trick
> is useful.
Ahh, that's how to do it. I was fumbling with
eval { "require $pack" };
which wasn't producing the correct results. I think I've
subconciously blocked the eval's string-form out of my mind. :-)
> PL> import $pack;
>
> and you should know better about indirect method calls! :)
>
> $pack->import() ;
>
> but that is useless if called at runtime as it won't import the
> symbols until too late. i told the OP about this problem too.
I do know better, but I've never quite grokked how to duplicate the
semantics of
use Mod;
vs
use Mod();
vs
use Mod(qw/foo bar baz/);
when it comes to calling import directly. Can that be done using the
direct method call?
> PL> I'm sure that's rife with bugs and won't work in all
> PL> situations, but
> PL> it might get you started at least?
>
> well you are correct there! :)
Indeed. Thanks for pointing some of them out.
Paul Lalli
------------------------------
Date: Wed, 20 Jun 2007 17:19:45 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: package filename mismatches ?
Message-Id: <x7ps3qy24u.fsf@mail.sysarch.com>
>>>>> "PL" == Paul Lalli <mritty@gmail.com> writes:
>> and you should know better about indirect method calls! :)
>>
>> $pack->import() ;
>>
>> but that is useless if called at runtime as it won't import the
>> symbols until too late. i told the OP about this problem too.
PL> I do know better, but I've never quite grokked how to duplicate the
PL> semantics of
PL> use Mod;
PL> vs
PL> use Mod();
PL> vs
PL> use Mod(qw/foo bar baz/);
PL> when it comes to calling import directly. Can that be done using the
PL> direct method call?
all use does is pass its args to the import call so you do the same:
Mod->import( qw/ foo bar baz / ) ;
or
$pack->import( qw/ foo bar baz / ) ;
an empty list is easy enough too. but you do have a point about no arg
list at all. that seems to be a feature of use and its syntax of no ()'s
there. it might be useful to examine the code in import() (which i have
done in the past. painful) and see how it knows if an empty list vs no
list was passed to it.
but as i keep saying, runtime import is silly. but then one module's
runtime is another's compile time so it could be useful in the right
circumstance.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 20 Jun 2007 17:50:51 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: package filename mismatches ?
Message-Id: <x7abuuy0p0.fsf@mail.sysarch.com>
>>>>> "UG" == Uri Guttman <uri@stemsystems.com> writes:
>>>>> "PL" == Paul Lalli <mritty@gmail.com> writes:
PL> I do know better, but I've never quite grokked how to duplicate the
PL> semantics of
PL> use Mod;
PL> vs
PL> use Mod();
PL> vs
PL> use Mod(qw/foo bar baz/);
UG> an empty list is easy enough too. but you do have a point about no arg
UG> list at all. that seems to be a feature of use and its syntax of no ()'s
UG> there. it might be useful to examine the code in import() (which i have
UG> done in the past. painful) and see how it knows if an empty list vs no
UG> list was passed to it.
i played with Exporter and it seems that use doesn't even call import if
passed an empty list (). so use does have a syntactical trick to skip
importing. but since your request now become moot as you can emulate the
semantics by just not calling import if you don't want it! this is no
different than saying use Foo() ;. as for no args or args, you just call
the import method as i showed before passing in whatever args you had on
the use line.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 20 Jun 2007 14:25:58 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Passing hash to another script via commandline
Message-Id: <WNaei.4611$Sm5.4154@trndny04>
IanW wrote:
> - is there a difference between "do" and backticks?
Ahemmm, I would say they have pretty much nothing in common.
jue
------------------------------
Date: Wed, 20 Jun 2007 06:43:35 -0700
From: tim_milstead@yahoo.co.uk
Subject: Re: Reference syntax
Message-Id: <1182347015.718289.170650@m36g2000hse.googlegroups.com>
- snip -
That makes sense. I only ask because page 182 of perl best practices
recommends named arguments are parsed like this:
sub padded {
------------------------------
Date: Wed, 20 Jun 2007 06:47:31 -0700
From: tim_milstead@yahoo.co.uk
Subject: Re: Reference syntax
Message-Id: <1182347251.429493.206280@p77g2000hsh.googlegroups.com>
On 20 Jun, 14:43, tim_milst...@yahoo.co.uk wrote:
Sorry sent before finishing:
That makes sense. I only ask because page 182 of perl best practices
recommends named arguments are parsed like this:
sub padded {
my ($arg_ref) = @_;
instead of:
sub padded {
my %arg = @_;
or even what I would have though:
my $arg_ref = \@_;
because non matched pairs causes a compile time error on the first and
a run time error on the second.
I'm not sure why the first is better than the third?
Tim
------------------------------
Date: Wed, 20 Jun 2007 14:40:12 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Reference syntax
Message-Id: <g%aei.9661$jb5.1760@trndny09>
tim_milstead@yahoo.co.uk wrote:
> On 20 Jun, 14:43, tim_milst...@yahoo.co.uk wrote:
> That makes sense.
What makes sense? Please quote appropriate context, such that people know
what you are responding to.
> I only ask because page 182 of perl best practices
> recommends named arguments are parsed like this:
>
> sub padded {
> my ($arg_ref) = @_;
Personally I would prefer
my $arg_ref = shift;
because your method becomes a pain when dealing with more than one
parameter.
> instead of:
>
> sub padded {
> my %arg = @_;
But those are totally different animals.
In the first sub you would be passing a reference (to e.g. an array or
hash), while in the second example you are passing the hash itself.
> or even what I would have though:
>
> my $arg_ref = \@_;
Well, that's yet another beast that has nothing to do with either of the
first examples. Of the top of my head I cannot think of a useful example
when you would want to create a reference to the parameter list.
> because non matched pairs causes a compile time error on the first and
Really?
> a run time error on the second.
Sure. When assigning a hash like that then it will only work if you got
key/value pairs.
> I'm not sure why the first is better than the third?
They are different animals that do different things.
jue
------------------------------
Date: Wed, 20 Jun 2007 08:22:18 -0700
From: ebandook@gmail.com
Subject: Rose Perl Reverse engg problems : Bad File Name
Message-Id: <1182352938.429187.57530@c77g2000hse.googlegroups.com>
Hi ,
I am trying to reverse engineer a *test* perl module using rational
rose. I start by opening a new perl project. Load up the file in rose
using Tools->Perl->Reverse Engineer
and then
select it and Tools->Perl->Generate
which gives me a Bad File Name or Number!!!.
Can anyone help ??
Also recomendations of reverse engineering perl code using other tools
are welcome.
Thanks
Ebby
The Code: test.pm
#!/usr/bin/perl
#Author : Ebrahim Bandookwala, HNS EXP
#Date :
#Project :
#Decription :
check (qw(This is a sentence));
sub check
{
my @var = @_;
print @var . "\n";
}
sub check2
{
my @var = @_;
print @var . "\n";
}
sub check3
{
my @var = @_;
print @var . "\n";
}
------------------------------
Date: Wed, 20 Jun 2007 13:09:41 -0000
From: Kaldrenon <kaldrenon@gmail.com>
Subject: Re: The Modernization of Emacs
Message-Id: <1182344981.372713.298580@w5g2000hsg.googlegroups.com>
Just so everyone's clear:
Nothing he has said makes much sense, if any.
He's talking about advocacy of something unique and powerful by -
making it less unique and powerful-. Not merely catering to the lowest
common denominator, but promoting something as better -by making it
worse-. Who does that?
Imagine that a man invents a vehicle that's far safer and more
maneuverable than any existing vehicle. Imagine that the increased
safety comes from the fact that it has five wheels. How incredibly
stupid would it be for that inventor to then say, "I'm going to
convince people to buy my new vehicle, which is safer thanks to this
fifth wheel. But in order to market it, I'll take the fifth wheel off,
so it's more familiar and comfortable for them."
I'm very, very new to emacs. I used it a little this past year in
college, but I didn't try at all to delve into its features. I'm
starting that process now, and frankly, the thought of it changing -
already- upsets me. I don't feel like the program ought to change in
order to accommodate me. I'm excited about the prospect of mastering
something new and different. The fewer resemblances to the common-
denominator, extra-friendly stuff I've worked with in the past, the
better.
Emacs' uniqueness may hurt its adoption rate, but it still has plenty
of users, who are all perfectly happy with how things are done.
-Andrew
------------------------------
Date: Wed, 20 Jun 2007 15:28:28 +0200
From: David Kastrup <dak@gnu.org>
Subject: Re: The Modernization of Emacs
Message-Id: <86y7ieoiv7.fsf@lola.quinscape.zz>
Kaldrenon <kaldrenon@gmail.com> writes:
> I'm very, very new to emacs. I used it a little this past year in
> college, but I didn't try at all to delve into its features. I'm
> starting that process now, and frankly, the thought of it changing -
> already- upsets me. I don't feel like the program ought to change in
> order to accommodate me.
Actually, the "E" in "Emacs" stands for "extensible". Part of the
appeal of Emacs is that you can change it to accommodate you.
> I'm excited about the prospect of mastering something new and
> different. The fewer resemblances to the common- denominator,
> extra-friendly stuff I've worked with in the past, the better.
>
> Emacs' uniqueness may hurt its adoption rate, but it still has
> plenty of users, who are all perfectly happy with how things are
> done.
Oh, but Emacs is not TeX: it _is_ being developed further. And some
changes are done in order to synchronize Emacs with the "other world"
where the latter has been oversleeping. For example, Emacs 23 will
internally use utf-8/Unicode as its encoding when it has used
emacs-mule up to now, a multibyte code of its own.
In spirit, this will not change Emacs much, yet it will remove
other-world friction and make Emacs more obviously the incarnation of
editing descended into this world.
--
David Kastrup
------------------------------
Date: Wed, 20 Jun 2007 13:44:21 -0000
From: Kaldrenon <kaldrenon@gmail.com>
Subject: Re: The Modernization of Emacs
Message-Id: <1182347061.347199.133480@g4g2000hsf.googlegroups.com>
On Jun 20, 9:28 am, David Kastrup <d...@gnu.org> wrote:
> Kaldrenon <kaldre...@gmail.com> writes:
> > I'm very, very new to emacs. I used it a little this past year in
> > college, but I didn't try at all to delve into its features. I'm
> > starting that process now, and frankly, the thought of it changing -
> > already- upsets me. I don't feel like the program ought to change in
> > order to accommodate me.
>
> Actually, the "E" in "Emacs" stands for "extensible". Part of the
> appeal of Emacs is that you can change it to accommodate you.
Well put. Perhaps I should have said that I don't feel like the
program ought to change to "accommodate" -everybody-.
I know that Emacs is still being worked on, is still growing and
changing, and also that, because of its extensibility, anyone can
change it as they wish. In fact, if the OP wants Emacs to behave the
way he describes, I'm sure it's doable. But my statement was that the
changes he suggests are things that should not be enforced
universally, because not only is there nothing wrong with the things
he suggests changing, but the idea of enforcing uniform changes is not
entirely in the spirit of Emacs.
------------------------------
Date: 20 Jun 2007 16:39:13 +0200
From: Bjorn Borud <borud-news@borud.no>
Subject: Re: The Modernization of Emacs
Message-Id: <m3fy4mk7vy.fsf@borud.not>
[Kaldrenon <kaldrenon@gmail.com>]
| Just so everyone's clear:
|
| Nothing he has said makes much sense, if any.
(it'd be good if you explicitly specify who "he" is since pronouns by
nature are extremely context sensitive, and in this context an
unattentive reader might think you are referring to me. thanks :-).
| Emacs' uniqueness may hurt its adoption rate, but it still has plenty
| of users, who are all perfectly happy with how things are done.
I don't see popularity as a goal in itself. I am selfish. I only
care what the software can do for me and I think that this is the only
way to write good software: make something you'd want to use
yourself.
-Bjørn
------------------------------
Date: Wed, 20 Jun 2007 12:39:00 -0400
From: jadamson@partners.org (Joel J. Adamson)
Subject: Re: The Modernization of Emacs
Message-Id: <874pl2eg2j.fsf@W0053328.mgh.harvard.edu>
Kaldrenon <kaldrenon@gmail.com> writes:
> On Jun 20, 9:28 am, David Kastrup <d...@gnu.org> wrote:
>> Kaldrenon <kaldre...@gmail.com> writes:
>> > I'm very, very new to emacs. I used it a little this past year in
>> > college, but I didn't try at all to delve into its features. I'm
>> > starting that process now, and frankly, the thought of it changing -
>> > already- upsets me. I don't feel like the program ought to change in
>> > order to accommodate me.
>>
>> Actually, the "E" in "Emacs" stands for "extensible". Part of the
>> appeal of Emacs is that you can change it to accommodate you.
>
> Well put. Perhaps I should have said that I don't feel like the
> program ought to change to "accommodate" -everybody-.
>
The point is that the responsibility to customize is on the user. All
the developers need to do is continue providing the most customizable
piece of software around. If we place the responsiblity to customize
on the developer, then he develops a piece of software customized for
himself; that wouldn't be Emacs.
Which brings me to another point: as someone already said, you could
fork the code and make all these changes, but then it would be
something else, it would stop being Emacs.
And it would stop being cool.
Joel
--
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA 02114
(617) 643-1432
(303) 880-3109
A webpage of interest:
http://www.gnu.org/philosophy/sylvester-response.html
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 541
**************************************