[23140] in Perl-Users-Digest
Perl-Users Digest, Issue: 5361 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 14 18:05:44 2003
Date: Thu, 14 Aug 2003 15:05:12 -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 Thu, 14 Aug 2003 Volume: 10 Number: 5361
Today's topics:
Re: Bug in perl? <asu1@c-o-r-n-e-l-l.edu>
Re: Bug in perl? <michael.p.broida@boeing.com>
Re: Bug in perl? <abigail@abigail.nl>
Embedded Javascript (XML/XSL) error on call to makeMenu <darthom@mindspring.com>
Re: Extremely Basic mySQL question. <tylercruz@hotmail.com>
Re: Extremely Basic mySQL question. <annoyed@you.now>
Re: Extremely Basic mySQL question. <emschwar@pobox.com>
Re: Extremely Basic mySQL question. <robsjobs@hotmail.com>
Re: Help w/ BNB Survey Script <-- (Lori Fleetwood)
Re: Help w/ BNB Survey Script <-- <uri@stemsystems.com>
Re: Help w/ BNB Survey Script <-- <chessql@highstream.net>
Re: Help w/ BNB Survey Script <-- <kkeller-spammmm@wombat.san-francisco.ca.us>
Re: how to autovivify a package from a string <emschwar@pobox.com>
Re: how to autovivify a package from a string <uri@stemsystems.com>
Re: how to autovivify a package from a string <emschwar@pobox.com>
Re: how to autovivify a package from a string <uri@stemsystems.com>
Re: how to autovivify a package from a string <emschwar@pobox.com>
Padded position in Consensus sequence <prakash@ece.arizona.edu>
Please offer critique on my 2nd JAPH <spamblock@junkmail.com>
Re: Please offer critique on my 2nd JAPH <uri@stemsystems.com>
Re: Please offer critique on my 2nd JAPH <spamblock@junkmail.com>
Re: Problem using Benchmark (Chris Charley)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Aug 2003 19:01:32 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Bug in perl?
Message-Id: <Xns93D798DA3BB4Dasu1cornelledu@132.236.56.8>
"Ian.H [dS]" <ian@WINDOZEdigiserv.net> wrote in
news:20030814174510.6d1d91b7.ian@WINDOZEdigiserv.net:
> On Thu, 14 Aug 2003 11:26:53 -0400 in
> <message-id:3F3BAA3D.5E5FDF9E@execonn.com>
> Marshall Dudley <mdudley@execonn.com> wrote:
>
>> Microsoft would never allow something sensible like that to
>> happen if it could prevent it.
AFAIK, internally command.com and cmd.exe never had any problems with / as
the path separator.
> cd ../
>
> for example will work on windoze.. but:
>
> cd ../../
>
> will only recognise the first instance of '../' and therefore, only
> backup one directory, rather than two.
>
> If anyone has info to the contrary, I'd be interested in hearing it..
> but this seemed to be the case for me, on a win2k box anyway.
On XP Pro,
cd ../../../../../
works as expected from a directory at the appropriate depth.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: Thu, 14 Aug 2003 20:42:48 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Re: Bug in perl?
Message-Id: <3F3BF448.826302FD@boeing.com>
"A. Sinan Unur" wrote:
>
> "Ian.H [dS]" <ian@WINDOZEdigiserv.net> wrote in
> news:20030814174510.6d1d91b7.ian@WINDOZEdigiserv.net:
>
> > On Thu, 14 Aug 2003 11:26:53 -0400 in
> > <message-id:3F3BAA3D.5E5FDF9E@execonn.com>
> > Marshall Dudley <mdudley@execonn.com> wrote:
> >
> >> Microsoft would never allow something sensible like that to
> >> happen if it could prevent it.
>
> AFAIK, internally command.com and cmd.exe never had any problems with / as
> the path separator.
>
> > cd ../
> >
> > for example will work on windoze.. but:
> >
> > cd ../../
> >
> > will only recognise the first instance of '../' and therefore, only
> > backup one directory, rather than two.
> >
> > If anyone has info to the contrary, I'd be interested in hearing it..
> > but this seemed to be the case for me, on a win2k box anyway.
>
> On XP Pro,
>
> cd ../../../../../
>
> works as expected from a directory at the appropriate depth.
Hmm, not on Win2K.
Mike
------------------------------
Date: 14 Aug 2003 21:48:49 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Bug in perl?
Message-Id: <slrnbjo0u1.bns.abigail@alexandra.abigail.nl>
Marshall Dudley (mdudley@execonn.com) wrote on MMMDCXXXV September
MCMXCIII in <URL:news:3F3B966C.D292F7B9@execonn.com>:
.. Perl 5.005_03 built for 386 freeBSD
..
.. I am trying to get perl to work on a windows system for the first time,
.. thus the path delimiters are \ instead of /. For some reason the
.. following very simple code will not compile:
..
.. $path = 'c:\home\mysite\cgi-bin\';
.. $site = 'mysite';
..
.. The problem seems to be the trailing \ on line 1, but that is needed as
.. part of the path so I can't leave it out.
..
.. Any ideas?
First, if you think you have found a bug in Perl, and your current
version of Perl is 5.005_03, don't bother posting it here, posting
it elsewhere, let alone report it to p5p.
5.005_03 was released 4 year, 4 months and some weeks ago. Since
then, we've had releases 5.6.0, 5.6.1 and 5.8.0, and already
4 trial releases of 5.8.1. Before reporting a bug, first find
if perhaps in the past 4 years the bug was already fixed.
Having said that, your situation isn't a bug. In fact, it's documented.
From 'man perlop':
q/STRING/
'STRING'
A single-quoted, literal string. A backslash rep
resents a backslash unless followed by the delim
iter or another backslash, in which case the
delimiter or backslash is interpolated.
Meaning that in the line:
$path = 'c:\home\mysite\cgi-bin\';
The final ' doesn't end the string - it's part of the string, because
it's escaped with the backslash.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Thu, 14 Aug 2003 14:30:09 -0400
From: Darrell Thompson <darthom@mindspring.com>
Subject: Embedded Javascript (XML/XSL) error on call to makeMenu
Message-Id: <12knjvc8eh9pgbfo5uanfjc0e9u3h7666l@4ax.com>
Hello Everyone:
Perhaps someone out there can help with this.
I am getting the following error when running a CGI (Perl) script that
generates a web page with embedded Javascript.
====
Cannot view XML input using XSL style sheet. Please correct the error
and then click the refresh button, or try again later.
A semi colon character was expected. Error processing resource
http://www.tekhome.com/cgi-bin/ft_update.pl?f=v&t=1&p=114 Line 46,
position 52
oM.makeMenu( 'm10','m1','Donald','ft_update.pl?f=v&t=0&p=86&r=114');
----------------------------------------------------^
====
As you can see, I am using the makeMenu javascript code with a twist.
Rather than have static menus from callable javascript files, I have
it embedded because my menus need to be dynamic.
The script works perfectly well on my Windows 2000 machine with
ActiveState's Perl and Perl Builder 2. It fails when accessed on my
HSP's Linux box.
They tell me it is my code because they supposedly have the latest
version of Perl for Linux.
The script I run on my machine is identical to the script I run on the
HSP except for which database the script points to for its data. All
references are to the HSP directories not to any local.
The error occurs on exactly the same character, the = sign following
the t, regardless if there is a fully defined url or not.
Any help or suggestions will be appreciated.
Sincerely,
Darrell
------------------------------
Date: Thu, 14 Aug 2003 20:39:53 GMT
From: "Tyler Cruz" <tylercruz@hotmail.com>
Subject: Re: Extremely Basic mySQL question.
Message-Id: <tsS_a.728744$3C2.16990275@news3.calgary.shaw.ca>
lol.. you need to get a life man. I did try both ways but wasn't sure..
maybe there was some bad characters that got in.. so i was asking to make
sure
don't you have anything better to do than just flame? life it TOO short
man.. hope you have a good day
Tyler
"Eric Schwartz" <emschwar@pobox.com> wrote in message
news:etosmo6o1l6.fsf@wormtongue.emschwar...
> "Tyler Cruz" <tylercruz@hotmail.com> writes:
> > I was wondering how should I download the mySQL dump to my computer via
FTP?
> > ASCII or binary? Or does it matter?
>
> Okay, unlike the MLDBM question, this one actually has bugger-all to
> do with Perl. But since some people somehow think clpm should be a
> haven to answer all questions, no matter what they have to do with the
> actual topic of the newsgroup, I'll be helpful anyway:
>
> If I were you, I'd try one, and then if it didn't work, I'd try the
> other. You know, if you had just tried, you probably would have
> already found out by now, and wouldn't have had to wait. Trying isn't
> fatal, you know.
>
> > Thanks a lot,
>
> Glad to help.
>
> -=Eric
> --
> Come to think of it, there are already a million monkeys on a million
> typewriters, and Usenet is NOTHING like Shakespeare.
> -- Blair Houghton.
------------------------------
Date: Thu, 14 Aug 2003 15:56:44 -0500
From: "Ivan Marsh" <annoyed@you.now>
Subject: Re: Extremely Basic mySQL question.
Message-Id: <pan.2003.08.14.20.56.40.962382@you.now>
On Wed, 13 Aug 2003 00:05:33 +0000, Tyler Cruz wrote:
> Hi,
>
> I was wondering how should I download the mySQL dump to my computer via
> FTP? ASCII or binary? Or does it matter?
>
> Thanks a lot,
>
> Tyler
Typically all FTP transfers are binary these days. There's no reason, that
I know of anyway, to use ASCII transfer specificly.
--
i.m.
The USA Patriot Act is the most unpatriotic act in American history.
------------------------------
Date: Thu, 14 Aug 2003 15:08:18 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Extremely Basic mySQL question.
Message-Id: <etobrusgd6l.fsf@wormtongue.emschwar>
"Tyler Cruz" <tylercruz@hotmail.com> writes:
> lol.. you need to get a life man. I did try both ways but wasn't sure..
> maybe there was some bad characters that got in.. so i was asking to make
> sure
So you check.
> don't you have anything better to do than just flame? life it TOO short
> man.. hope you have a good day
Too short for clpm to become flooded with tons of irrelevant questions
because people like you can't be arsed to actually find a relevant
newsgroup.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 14 Aug 2003 15:10:20 -0600
From: "Rob Petty" <robsjobs@hotmail.com>
Subject: Re: Extremely Basic mySQL question.
Message-Id: <1VS_a.52$RW5.27451@news.uswest.net>
(you will find my comments at the BOTTOM of the post...)
"Tyler Cruz" <tylercruz@hotmail.com> wrote in message news:tsS_a.728744$3C2.16990275@news3.calgary.shaw.ca...
> lol.. you need to get a life man. I did try both ways but wasn't sure..
> maybe there was some bad characters that got in.. so i was asking to make
> sure
>
> don't you have anything better to do than just flame? life it TOO short
> man.. hope you have a good day
>
> Tyler
>
> "Eric Schwartz" <emschwar@pobox.com> wrote in message
> news:etosmo6o1l6.fsf@wormtongue.emschwar...
> > "Tyler Cruz" <tylercruz@hotmail.com> writes:
> > > I was wondering how should I download the mySQL dump to my computer via
> FTP?
> > > ASCII or binary? Or does it matter?
> >
> > Okay, unlike the MLDBM question, this one actually has bugger-all to
> > do with Perl. But since some people somehow think clpm should be a
> > haven to answer all questions, no matter what they have to do with the
> > actual topic of the newsgroup, I'll be helpful anyway:
> >
> > If I were you, I'd try one, and then if it didn't work, I'd try the
> > other. You know, if you had just tried, you probably would have
> > already found out by now, and wouldn't have had to wait. Trying isn't
> > fatal, you know.
> >
> > > Thanks a lot,
> >
> > Glad to help.
> >
> > -=Eric
> > --
> > Come to think of it, there are already a million monkeys on a million
> > typewriters, and Usenet is NOTHING like Shakespeare.
> > -- Blair Houghton.
>
>
He doesn't need to get a life, you need to get another group. Try mailing.database.mysql!
Your post is off topic. No one here really deals with the issue since this is a PERL group. MySQL is a different product
(programming language vs database). You using Net::FTP?.... Still doesn't matter. The question is Still a MySQL question. Not
a Perl issue.
The issue really comes down to whether you're dumping blob data or not. If not then it really doesn't matter. If so, then you
better stick with binary.
Rob
------------------------------
Date: 14 Aug 2003 13:42:31 -0700
From: deficitschmeficit@yahoo.com (Lori Fleetwood)
Subject: Re: Help w/ BNB Survey Script <--
Message-Id: <94156c98.0308141242.6104a6f2@posting.google.com>
tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbjnguu.7lc.tadmc@magna.augustmail.com>...
> Lori Fleetwood <deficitschmeficit@yahoo.com> wrote:
> > noreply@gunnar.cc (Gunnar Hjalmarsson) wrote in message news:<3fcbff18.0308131711.89ae07e@posting.google.com>...
> >> Uri Guttman wrote:
> >> > >>>>> "LF" == Lori Fleetwood writes:
> >> >
> >> > LF> don't you mean "ask the moron authors for help"?
>
>
> > You missed my point.
>
>
> Your point, as with all trolls, is to stir up controversy.
Yeah, like that time you chided somebody for thanking you, because in
doing so they didn't strictly adhere to usenet protocol. Isn't it
ironic that a motto of Perl is "there's more than one way to do it",
but so many in clpm are fanatics as to "there's only one way to
usenet"?
------------------------------
Date: Thu, 14 Aug 2003 20:45:05 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Help w/ BNB Survey Script <--
Message-Id: <x7isp0ynn2.fsf@mail.sysarch.com>
>>>>> "LF" == Lori Fleetwood <deficitschmeficit@yahoo.com> writes:
LF> tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbjnguu.7lc.tadmc@magna.augustmail.com>...
>> Lori Fleetwood <deficitschmeficit@yahoo.com> wrote:
>> > noreply@gunnar.cc (Gunnar Hjalmarsson) wrote in message news:<3fcbff18.0308131711.89ae07e@posting.google.com>...
>> >> Uri Guttman wrote:
>> >> > >>>>> "LF" == Lori Fleetwood writes:
>> >> >
>> >> > LF> don't you mean "ask the moron authors for help"?
>>
>>
>> > You missed my point.
>>
>>
>> Your point, as with all trolls, is to stir up controversy.
LF> Yeah, like that time you chided somebody for thanking you, because in
LF> doing so they didn't strictly adhere to usenet protocol. Isn't it
LF> ironic that a motto of Perl is "there's more than one way to do it",
LF> but so many in clpm are fanatics as to "there's only one way to
LF> usenet"?
you forget that perl and usenet are not the same. usenet is a
communications medium where we all use it and abide by community
rules. perl is a programming language which allows multiple ways to
solve problems (even if most are suboptimal). conflating the two shows
how ignorant you are. please just hang out with moronzilla. she and you
will get along fine.
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: Thu, 14 Aug 2003 15:12:14 -0600
From: Lori Fleetwood <chessql@highstream.net>
Subject: Re: Help w/ BNB Survey Script <--
Message-Id: <3NS_a.2848$Q5.1404@fe01.atl2.webusenet.com>
Uri Guttman wrote:
>>>>>>"LF" == Lori Fleetwood <deficitschmeficit@yahoo.com> writes:
>
>
> LF> tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbjnguu.7lc.tadmc@magna.augustmail.com>...
> >> Lori Fleetwood <deficitschmeficit@yahoo.com> wrote:
> >> > noreply@gunnar.cc (Gunnar Hjalmarsson) wrote in message news:<3fcbff18.0308131711.89ae07e@posting.google.com>...
> >> >> Uri Guttman wrote:
> >> >> > >>>>> "LF" == Lori Fleetwood writes:
> >> >> >
> >> >> > LF> don't you mean "ask the moron authors for help"?
> >>
> >>
> >> > You missed my point.
> >>
> >>
> >> Your point, as with all trolls, is to stir up controversy.
>
> LF> Yeah, like that time you chided somebody for thanking you, because in
> LF> doing so they didn't strictly adhere to usenet protocol. Isn't it
> LF> ironic that a motto of Perl is "there's more than one way to do it",
> LF> but so many in clpm are fanatics as to "there's only one way to
> LF> usenet"?
>
> you forget that perl and usenet are not the same. usenet is a
> communications medium where we all use it and abide by community
> rules. perl is a programming language which allows multiple ways to
> solve problems (even if most are suboptimal). conflating the two shows
I don't know how you've become so good with Perl with one half of your
brain apparently turned off: just because perl and usenet are not the
same does not mean that how people approach the two of them cannot be
compared. You'd probably be a Perl god if you didn't think in such a
linear fashion all the time. Perhaps you know this and the frustration
is why you can be such a d!ckhead at times.
------------------------------
Date: Thu, 14 Aug 2003 14:22:24 -0700
From: Keith Keller <kkeller-spammmm@wombat.san-francisco.ca.us>
Subject: Re: Help w/ BNB Survey Script <--
Message-Id: <giughb.sa1.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In article <3NS_a.2848$Q5.1404@fe01.atl2.webusenet.com>, Lori Fleetwood wrote:
> I don't know how you've become so good with Perl with one half of your
> brain apparently turned off: just because perl and usenet are not the
> same does not mean that how people approach the two of them cannot be
> compared. You'd probably be a Perl god if you didn't think in such a
> linear fashion all the time. Perhaps you know this and the frustration
> is why you can be such a d!ckhead at times.
Perhaps you could spend your time answering the OP, since you seem so
offended at efforts not to do so?
- --keith
- --
kkeller-mmmspam@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAj87/Y8ACgkQhVcNCxZ5ID99ugCfUSghqb3hRJFyycQgc9IRSqxX
tWYAn3r2BGjUs5b9Y637lXLWnAOY3asu
=Q/hh
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 14 Aug 2003 13:15:01 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: how to autovivify a package from a string
Message-Id: <etofzk4hwzu.fsf@wormtongue.emschwar>
Nicholas Dronen <ndronen@io.frii.com> writes:
> My naive answer is:
<snip dynamic package creation code>
I don't have the answer myself, I only comment as two people have
apparently misinterpreted: the OP can generate the classes just fine,
what he's having trouble with is autovivifying them.
To the OP: If you can live without autovivification, the best answer I
can come up with is to use a factory pattern to build the classes for
you. It's not automatic, but it's nearly so.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 14 Aug 2003 20:06:22 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: how to autovivify a package from a string
Message-Id: <x7smo4ypfm.fsf@mail.sysarch.com>
>>>>> "ES" == Eric Schwartz <emschwar@pobox.com> writes:
ES> Nicholas Dronen <ndronen@io.frii.com> writes:
>> My naive answer is:
ES> <snip dynamic package creation code>
ES> I don't have the answer myself, I only comment as two people have
ES> apparently misinterpreted: the OP can generate the classes just fine,
ES> what he's having trouble with is autovivifying them.
packages or classes have nothing to do with
autovivification. autovivification is when an undef value is
dereferenced and perl will automatically create the appropriate
reference type and replace the undef value with the new ref. how does
that affect classes or packages?
ES> To the OP: If you can live without autovivification, the best answer I
ES> can come up with is to use a factory pattern to build the classes for
ES> you. It's not automatic, but it's nearly so.
and that makes little sense either. perl doesn't need most patterns as
it is a higher level language with many of those (silly) things built
in.
if the OP would post again and clarify what the real problem is (not
their partial solution) i am sure we can help. but autovivification of
classes makes no sense.
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: Thu, 14 Aug 2003 14:14:29 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: how to autovivify a package from a string
Message-Id: <eto3cg4hu8q.fsf@wormtongue.emschwar>
Uri Guttman <uri@stemsystems.com> writes:
>>>>>> "ES" == Eric Schwartz <emschwar@pobox.com> writes:
> ES> To the OP: If you can live without autovivification, the best answer I
> ES> can come up with is to use a factory pattern to build the classes for
> ES> you. It's not automatic, but it's nearly so.
>
> and that makes little sense either. perl doesn't need most patterns as
> it is a higher level language with many of those (silly) things built
> in.
A pattern is simply a programming concept. Factory patterns make as
much (or as little, I suppose) sense in Perl as they do in any other
language. Just glancing at the inside of my _Design Patterns_ book,
most of them seem quite applicable to OO programs written in Perl.
> if the OP would post again and clarify what the real problem is (not
> their partial solution) i am sure we can help. but autovivification of
> classes makes no sense.
I agree, more clarification would help here.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 14 Aug 2003 20:17:55 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: how to autovivify a package from a string
Message-Id: <x7lltwyowc.fsf@mail.sysarch.com>
>>>>> "ES" == Eric Schwartz <emschwar@pobox.com> writes:
ES> Uri Guttman <uri@stemsystems.com> writes:
>>>>>>> "ES" == Eric Schwartz <emschwar@pobox.com> writes:
ES> To the OP: If you can live without autovivification, the best answer I
ES> can come up with is to use a factory pattern to build the classes for
ES> you. It's not automatic, but it's nearly so.
>>
>> and that makes little sense either. perl doesn't need most patterns as
>> it is a higher level language with many of those (silly) things built
>> in.
ES> A pattern is simply a programming concept. Factory patterns make as
ES> much (or as little, I suppose) sense in Perl as they do in any other
ES> language. Just glancing at the inside of my _Design Patterns_ book,
ES> most of them seem quite applicable to OO programs written in Perl.
and most of them are not needed since perl is so dynamic. calling a
scalar var some silly pattern name just because it can hold ANYTHING
(which requires massive ugly pattern code in c++) is silly. factory
pattern is another silly name. it is so trivial to generate stuff in
perl from multiple classes that even calling it factory is overkill. a
simple hash table of token to class names is all you need. late binding
and polymorphism are built in and do all the hard work.
>> if the OP would post again and clarify what the real problem is (not
>> their partial solution) i am sure we can help. but autovivification of
>> classes makes no sense.
ES> I agree, more clarification would help here.
which is why your patterns comments seemed even more out of place to me.
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: Thu, 14 Aug 2003 15:18:23 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: how to autovivify a package from a string
Message-Id: <eto7k5ggcps.fsf@wormtongue.emschwar>
Uri Guttman <uri@stemsystems.com> writes:
> and most of them are not needed since perl is so dynamic. calling a
> scalar var some silly pattern name just because it can hold ANYTHING
> (which requires massive ugly pattern code in c++) is silly.
A pattern is just a way of thinking about a problem; it's not even an
algorithm. I don't understand your apparent antipathy.
> factory
> pattern is another silly name. it is so trivial to generate stuff in
> perl from multiple classes that even calling it factory is overkill. a
> simple hash table of token to class names is all you need.
The classic factory pattern implementation would wrap that table with
a function called CreateFoo(); that's hardly overkill. Anyway, you
need some string to index that hash with, and using a factory pattern
doesn't require the user to know the details of how it's generated.
> late binding and polymorphism are built in and do all the hard work.
They're helpful, surely, but a Command pattern is useful (especially
when keeping multilevel undo-redo stacks no matter when binding is
done, and polymorphism doesn't remove the need for it. Adapter
patterns are pretty much always going to be required when you have an
existing class whose interface doesn't match that of the environment
you want to use it in.
> ES> I agree, more clarification would help here.
>
> which is why your patterns comments seemed even more out of place to me.
Because if he's trying to do what I think he's trying to do, then a
factory would help. If he's not, then nevermind. Either way, more
clarification will help.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 14 Aug 2003 11:18:03 -0700
From: Jayaprakash Rudraraju <prakash@ece.arizona.edu>
To: "bioperl-l@bioperl.org" <bioperl-l@bioperl.org>
Subject: Padded position in Consensus sequence
Message-Id: <Pine.GSO.4.50.0308141049460.17345-100000@shellfish.ece.arizona.edu>
Hi,
I have written a small subroutine to as part of the program to tag primers
in Consed. The following subroutine gives padded position on the consensus
sequence, given its position on reference sequence.
#!perl -w
my $consensus = "AGG*TGAC**TA***AGTCCT*T";
print map { "$_\t". padded_position($_) ."\n"} (1..16);
sub padded_position {
my ($unpad, $pads) = (@_, 0);
$pads++ until $unpad == substr($consensus, 0, $unpad+$pads) =~ tr/ACGT//;
$unpad+$pads;
}
can you suggest me some more efficient or elegant solutions. Eventhough I
have condensed it as much as I can, I am looking for a simpler logic.
Prakash.
--
My favorite animal is steak.
-- Fran Lebowitz (1950 - )
------------------------------
Date: Thu, 14 Aug 2003 13:25:17 -0700
From: "David Oswald" <spamblock@junkmail.com>
Subject: Please offer critique on my 2nd JAPH
Message-Id: <vjns4sfdeivt64@corp.supernews.com>
Here's my second JAPH. I think it's clever, but, after all, I'm new to
Perl, so I'm easily wowed. Have a look at it, tell me what you think, and
offer suggestions for improving upon it. It's a learning experience for me,
so naturally I'd love to hear constructive comments.
Here goes.....
$d
=";;;;;;;;;;;;;;;:::::::::::::::::::::::::::::::::::::::::::::::::::;;;;;;;;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::::::::::::::::::::::::::::::::::::::::::;;;
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::::
::::
:::::::::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;:
::::::::::::::::::::::::::::::::::::::::::::::::;:::::::::::::::::::::::::::
::::
::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::::::::::::::::
::::
:::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::
::::
::::::::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;;;;;::::::::::::::::::::::::::::::::::;::::::::::::::::::::::::::::::::::
::::
:::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::::::
::::
:::::::::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;;";while ($d=~/(["$d"])\1*$/){$/=$&;print chr((chomp $d)+(unpack
"c",$")-1);}
print "\n";
If you cut-and-paste it, remove all newlines from the text. Any line breaks
or whitespace in the string literal will break the program, and thus, is
significant.
Please let me know what you think...
Dave
--
DJO
------------------------------
Date: Thu, 14 Aug 2003 20:46:40 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Please offer critique on my 2nd JAPH
Message-Id: <x7fzk4ynkf.fsf@mail.sysarch.com>
by tradition, japhs have to fit in 4 lines so they can be signatures. my
quick guess without even looking is that you encoded the chars by the
number of : or ; in a row.
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: Thu, 14 Aug 2003 14:48:18 -0700
From: "David Oswald" <spamblock@junkmail.com>
Subject: Re: Please offer critique on my 2nd JAPH
Message-Id: <vjo196r86qui38@corp.supernews.com>
"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7fzk4ynkf.fsf@mail.sysarch.com...
>
> by tradition, japhs have to fit in 4 lines so they can be signatures. my
> quick guess without even looking is that you encoded the chars by the
> number of : or ; in a row.
Your quick guess is accurate. I figured that would be guessed. The trick
was using chomp as the counting device rather than some other more common
method. This, of course, involved reassigning what Perl viewed as the
newline character repeatedly. In my mind it was a fun method.
Perhaps I should build the string up to bytes from a series of bits, to
avoid such a long literal, which contributed to the JAPH exceeding the four
line tradition.
Dave
------------------------------
Date: 14 Aug 2003 12:49:41 -0700
From: charley@pulsenet.com (Chris Charley)
Subject: Re: Problem using Benchmark
Message-Id: <4f7ed6d.0308141149.2a19a174@posting.google.com>
jkeen@concentric.net (James E Keenan) wrote in message news:<b955da04.0308140445.479cb805@posting.google.com>...
> charley@pulsenet.com (Chris Charley) wrote in message news:<4f7ed6d.0308131630.37814d3e@posting.google.com>...
> > Hi
> >
> > I hope someone might point out the obvious error in my benchmark tests.
>
> I was able to copy-and-paste your code and run it with the arguments
> you used. It ran properly. So the error is not "obvious" to me.
> What were you expecting to happen?
Well Jim, I was expecting the first test (creating array) and the
second test (creating string) to have similar results or the string
version to be faster. As can be seen, the array version was way too
fast (I think) compared to the string version.
Tassilo did have a good point in that if the code measured is a
fraction of the time to call a function, perhaps the code tested is so
trivial it may not be worth a benchmark. I'll have to consider that
point.
Chris
------------------------------
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.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 5361
***************************************