[10187] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3780 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 21 20:07:19 1998

Date: Mon, 21 Sep 98 17:00:18 -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, 21 Sep 1998     Volume: 8 Number: 3780

Today's topics:
        commented matching <jspin@csd.sgi.com>
    Re: commented matching <jspin@csd.sgi.com>
    Re: commented matching <dgris@rand.dimensional.com>
    Re: even/odd numbers (David Formosa)
    Re: even/odd numbers (John Moreno)
    Re: Help with perl hashes of hashes and arrays of hashe <r28629@email.sps.mot.com>
    Re: JAPH: how does this .sig work? (Tramm Hudson)
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl & Java - differences and uses bjohnsto_usa_net@my-dejanews.com
    Re: Perl & Java - differences and uses bjohnsto_usa_net@my-dejanews.com
    Re: Perl & Java - differences and uses <eashton@bbnplanet.com>
    Re: Perl & Java - differences and uses (David Formosa)
    Re: PerlMagick & linux <jdw@dev.tivoli.com>
    Re: problems using "use", HELP! <baliga@synopsys.com>
    Re: problems using "use", HELP! <rick.delaney@shaw.wave.ca>
    Re: problems using "use", HELP! <kchunt@mail.hac.com>
        split function not working properly? <vincent@psnw.com>
    Re: split function not working properly? <ajohnson@gpu.srv.ualberta.ca>
    Re: split function not working properly? <eashton@bbnplanet.com>
    Re: Using perl module <baliga@synopsys.com>
    Re: where is Date::Parse (CPAN.pm)? <rra@stanford.edu>
    Re: where is Date::Parse? (Abigail)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 21 Sep 1998 16:06:36 -0700
From: Joe Spinney <jspin@csd.sgi.com>
Subject: commented matching
Message-Id: <3606DBFC.3052CC95@csd.sgi.com>

Hello,

for some reason I can't get the following match to work unless I do it
in a single line

this fails to match:

$string =~ m{
    ^\s+        # one or more leading spaces
    (\S+)X    # remember anything but spaces until 'X'
    \s+$    # followed by 1 or more spaces until the end
}m;

but this works:

$string =~ m/^\s+(\S+)X\s+$/;

maybe the first one does work, but when I try to use $1 it's
non-existant

Thanks in advance for any help...
--Joe


--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
      ______________________
     /     /   /   /   /   /\
     \__  /   /   /   /   /  \
Joe      ~   /   /   /   /   /\
 Spinney    ~   /   /   /   /  \
               ~   /   /   /   /\
Prog/Analyst      ~   /   /   /  \
Silicon Graphics     /   /   /   /\
Mountain View, CA   /   ~   /   /  \
                   /       ~   /   /\
ph# (650)933-6966             ~   /  \
pager# (650)528-8360             ~    \
email: jspin@csd.sgi.com           \__/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=





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

Date: Mon, 21 Sep 1998 16:23:03 -0700
From: Joe Spinney <jspin@csd.sgi.com>
Subject: Re: commented matching
Message-Id: <3606DFD7.60A0CDAB@csd.sgi.com>

oops, I meant to put the 'x' flag at the end of the match pattern, not
the 'm', but regardless it doesn't seem to work




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

Date: Mon, 21 Sep 1998 23:43:55 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: commented matching
Message-Id: <6u6neo$5b9$1@rand.dimensional.com>

[posted to comp.lang.perl.misc and mailed to the cited author]

In article <3606DBFC.3052CC95@csd.sgi.com>
Joe Spinney <jspin@csd.sgi.com> wrote:

>$string =~ m{
>    ^\s+        # one or more leading spaces
>    (\S+)X    # remember anything but spaces until 'X'
>    \s+$    # followed by 1 or more spaces until the end
>}m;
  ^^
Add an x there and it'll be fine.

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the 
ending, but it still kind of surprised me.'
      David Hatunen, talking about the movie Titanic


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

Date: 22 Sep 1998 09:10:52 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: even/odd numbers
Message-Id: <6u6mds$leq$1@godzilla.zeta.org.au>

In <1dfpeu9.llzsaq1ybj3c0N@roxboro0-002.dyn.interpath.net> phenix@interpath.com (John Moreno) writes:

>Tom Christiansen <tchrist@mox.perl.com> wrote:

>>  [courtesy cc of this posting sent to cited author via email]

>Unnecessarily so.  For the record - all followups to my own articles are
>clearly displayed for me by my newsreader.

However Usenet is a best effort system there is a good chance that your 
reply will go missing.



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

Date: Mon, 21 Sep 1998 19:48:15 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: even/odd numbers
Message-Id: <1dfq1dz.u9q88917c0fnkN@roxboro0-012.dyn.interpath.net>

David Formosa <dformosa@zeta.org.au> wrote:

> phenix@interpath.com (John Moreno) writes:
> 
> >Tom Christiansen <tchrist@mox.perl.com> wrote:
> 
> >>  [courtesy cc of this posting sent to cited author via email]
> 
> >Unnecessarily so.  For the record - all followups to my own articles are
> >clearly displayed for me by my newsreader.
> 
> However Usenet is a best effort system there is a good chance that your
> reply will go missing.

I realize that, but nothing in this thread is of sufficient importance
to rate email to insure delivery.

-- 
John Moreno


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

Date: Mon, 21 Sep 1998 17:15:44 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Help with perl hashes of hashes and arrays of hashes etc
Message-Id: <3606CFFA.2B9DA321@email.sps.mot.com>

Brent Perschbacher wrote:
> @database = ();

Looks like you zapped @database every time before you 'add' a hash imto it.

>  for $i (0 .. $#database){

beware that Perl actually create temporory array [0,1,2,..,$#database], which
may burt a lot of memory and hence slow down you system performance.

Lastly, please read the section 'Programming with style' in your Camel book.
There still isn't a formatter around to tidy up Perl codes.


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

Date: 21 Sep 1998 16:01:35 -0600
From: tbhudso@panther.cs.sandia.gov (Tramm Hudson)
Subject: Re: JAPH: how does this .sig work?
Message-Id: <6u6ibv$bql$1@panther.cs.sandia.gov>

In article <36068FB8.2452@pcocd2.intel.com>,
Arvind K. Karandikar <akarandi@pcocd2.intel.com> wrote:
[Snip]
>i found this .sig in one of Abigails' posts:
>
>perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
>          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
>          print chr 0x$& and q
>          qq}*excess********}'
>
>and i'm stumped as to how we end up with japh from this. i figure $_ is 
>being stored with some encoding of japh, but didn't get much further 
>than this.

[Snip the rest, including the questions that I am ignoring]

It seems that Abigail has jumped through some hoops to make this
obfuscated, when there is a much simpler way to produce the same
output given the input string:

perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
	print map {chr hex "0x$_"} m/(..)/g'

The string is just the hex representation of the ASCII string to be
output.  You can make your own strings with od -x if you like.  However,
YMMV depending on the byte ordering.  Use od -t x1 if your system
supports it.

echo "Foo Bar and Baz" | od -t x1
> 0000000 46 6f 6f 20 42 61 72 20 61 6e 64 20 42 61 7a 0a
perl -e '$_ = q *466f6f2042617220616e642042617a0a*;
	print map {chr hex "0x$_"} m/(..)/g'

Just to keep the conversation going, here are two of my entries
for the japh "contest":

perl -e 'print map{$n=hex $_;/[A-F0-9]/&&((map{$_?"L":" "}(map{$n&$_}
(map{1<<$_}(reverse (0..3))))),++$l%16?"":"\n")} (split //,
"2A6E1  249D    5    D   C  0   0   0   1 2   A 842B   5495  140  0   0
   1    2  A   E 4   3A D4  9D D8   0   0 0   1 A   A 2     4   2 AD  4
   9    514   0   0  0 1 4  4 C 4   2A489 5   D 2   0 00119 D   C 8 5 2
   3    5  7  70000  1 1 5  1 4 8   5   5 4   5 4   5     0 0   0 0  11
   9    9   8 8   7  7 4 6  6 6 0   0   0 01 U1 1   1     4 8   5 5   4
   5    4   5 0   0  0   0  1   1   1   D  2E5  5357   480   001  "   )'

and

perl -e '
print map{($c,$o)=("/"," ");(map{ if(/[0-9]/){ ($c,$o)=($o,$c); $c x $_} }
map{(/[^A-Z]/&&$_)||split(//,scalar("1"x(ord($_)-ord("A")+1)));}split //),"\n"}
qw( 3E22A34A2A2A2A23E3A3 3G4A4D2F2A2E3C 3F32A43C2D2A23A3A2 H3A2A4F2D2A2E3C
    2A3A223A4E2A2A3A2D3B21 0 4223A32A4C2A32E3A3 4E3C2A4I3E3C
    4222223A43A3B322222 4A3A3C2A4I3E3C 4A33B2B32G22E3B2A)'

I ran out of time trying to reformat the second one in an egotistic
fashion, but may redo it later.  Always looking for comments on better
ways to code things!  What did dmr say about this?  Capture regularity
in data or is it the other way around?

Tramm
-- 
  o   hudson@cs.tulane.edu            tbhudso@cs.sandia.gov   O___|   
 /|\  http://www.cs.tulane.edu/~hudson/     H 505.266.59.96   /\  \_  
 <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.284.24.32   \ \/\_\  
  0                                                            U \_  | 


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

Date: Mon, 21 Sep 1998 17:08:34 -0500
From: "George Reese" <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <F7AN1.1237$Ge.3822355@ptah.visi.com>


Felix S. Gallo wrote in message <6u677j$sek@enews2.newsguy.com>...
>George keeps trying:
>>fsg wrote in message <3605A0F8.4CA9E00E@ultranet.com>...
>>>George, your schtick was briefly amusing in the sophomore-learns-a
>>>new-language-and-decides-its-the-bestest-ever kind of way, but these
>>>repetitious assertions of categorical fact and incoherent, raving
>>>evangelism are making you out as a dolt in front of millions of your
>>>potential employers and coworkers.
>>
>>Is a barrage of insults commonly accepted in comp.lang.perl.misc as a
>proper
>>form of argumentation?
>
>Speaking of which, if you're going to fall back on 'this is not a proper
>form
>of argumentation' whenever someone makes a point, I'm going to have
>to ask you exactly what form of argumentation you are attempting to
>require.

If you are truly puzzled about my rejection of a barrage of insults as an
improper form of argumentation, then you really are not worthy of even this
response.

I will characterize your argumentation style for each paragraph you have
offered up.

> Please be specific.  In going back through your posts, I've yet
>to find one that wasn't either absurd, unsubstantiated, incoherently
placed,
>argument to unfounded authority, ad hominem, or circular logic -- so
>please make sure you're not hypocritical in your selection.


*Unsupported assertion*

One generally requires some sort of evidence to backup assertions.  I have
not at all engaged in argument based on authority, ad hominem, or circular
logic.  I may have made some claims that were initially unsubstantiated, but
I have in turn always followed those up with substantiation.  Absurd?  I
have no idea exactly what you mean by absurd, so I won't touch that one.
And incoherently placed?  Yes, I made one stupid mistake that was an
incoherently placed argument.

Given the amount of venom to which I have been responding, I think this is,
all-in-all, a very good track record for an informal forum.

>>You and Uri just keep repeating the mantra that I think OO is for
>everything
>>in spite of the fact that I have repeatedly stated that is not the case.
>>And here you misrespresent my point view punctuated with an insult.
>
>
>The fact that you contradict yourself implies that you're irrational,

*Supported argument, but invalid*

Actually, it does not.  I have contradicted myself once and exactly once,
and I acknowledged that.  A single instance of self-contradiction does not
make one irrational.

> but
>it doesn't free you from having to explain your statements, such as
>the one about how if you don't design algorithms with design patterns,
>you're doing voodoo (I passed that around the office, and everyone
>fell about laughing, by the way.  Nice.)

*Valid argument, but false since it counters established facts*

You can keep your head in the sand, but you cannot change the fact I have
explained why failing to use established design patterns is voodoo.  You are
also attempting to drag this thread into irrelevancies.

>  You've made a number of
>authoritative and objective statements about how OO is mandatory.

*Unsupported argument*

No, I have not.

>That you have then occasionally retreated into a fumbling, semi-
>apologetic uh-that-is-not-what-I-really-meant when confronted by,
>e.g., Larry, is not good enough.


*Unsupported argument*

No, I have not.  I have retreated from one thing I have stated.  I stand by
everything else.  I have provided arguments to support everything.  I have
clarified my statements where people have been misinterpreting them.

In some cases, this misinterpretation appears willfull.

>> You are the only person I have ever
>>heard make this ridiculous claim.  Even in this thread, no one has tried
>>that line of argumentation.
>
>Mmm, proof by quantity.  You say you studied argumentation where?


*Argument by implied insult*

It is called a preponderance of the evidence.

>In any case, python really is a subset of Perl, if you study both their
>opcode sets.  Perl provides _more_ ways to structure programs,
>and so in the hands of a capable programmer, can be more cleanly
>structured.  No, it's not forced on you -- but you don't seem to
>understand that there is no linkage between syntactic bondage and
>program goodness.


*Non-sequitur*

As I have argued before, there is one.  But you have not bothered to provide
an argument to counter my points.  You just boldly put forth this
mini-argument that ignores everything I have stated before.

>>>Once you actually begin to design algorithms in the real world,
>>>you will find out that this sentence, beyond just not making any
>>>kind of sense at all, is purest levity.
>>
>>You mean once I do what I have been doing for years, something I am a
>>recognized expert in?  Damn!
>
>Please explain who is recognizing you as an expert.  I've never heard
>of you, and the only person I know who has thinks that you program
>for MUDs.


*Question, not an argument*

I have not coded for muds in like 3 years.  Abigail doesn't have the
foggiest idea who I am and is very prone to spouting crap.  And if I provide
credentials of my expertise, are you gonna attack me as arguing from
authority?

No thanks.  I am fairly certain a large number of the people reading this in
comp.lang.java.programmer know who I am and that almost none of the perl
people have any idea who I am. If you would like a bit of irony, however, I
believe my book was one of O'Reilly's best selling titles at last year's
Perl conference.  I believe it was number 3 behind the NT book and the Java
in a Nutshell second edition.

>>>For a good real world example that you can study the source code
>>>for, try the perl5 regular expression code.  It was not designed
>>>with 'design patterns' in mind -- in fact, it was invented more
>>>than a decade before 'design patterns' became the latest vogue --
>>>but it has survived numerous attempts to supplant it with
>>>replacements designed by 'OO methodologies' (sic).  Why?  Because
>>>cleanliness is not everything.  In some cases, speed is
>>>everything.  In others, functionality is everything.  In still
>>>others, cost is everything.  In my several years of real world
>>>software, I would guess that speed and cost have been my most
>>>usual requirements, followed by cleanliness and thence by
>>>functionality.
>>
>>And this would be why I would not hire you.
>
>I continue to believe that you are not employed as an actual software
>programmer; the possibility just seems so remote.  But in the event
>that you are, you must just be starting out.  So let me provide you
>with a little real world advice: get flexible in your thinking or prepare
>to be jobless.  The real world software industry does not screw
>around with people who think their one big idea is the solution to
>all the problems in the world.


*Patronizing insults*

Where have I offered one solution to solve all the world's problems?

>>>By the by, I'm also a major advocate of design patterns, have
>>>written articles, etc., etc.  But it's just _funny_ to suggest
>>>that even a third of your code can be based on the current art.
>>
>>Funny only if you do not understand anything about OO software
engineering.
>
>More un-backed-up assertions.

*True argument*

Well, I suppose it matters whose design patterns you are talking about.  If
you are talking about some small toolkit of design patterns you have, then
you probably actually rarely use them.  Or you have a large toolkit and
simply choose not to use them.  Either way, that backs up my assertion that
the above statement is funny only for those who do not understand OO.

In the project I am delivering into testing next week, I would say most of
my classes make use of one or more design patterns from authorities such as
the gang of 4.

> As backup, the 150 years of OO software
>engineering experience I'm familiar with (me, coworkers, and all the people
>I know in the field) believe that you are totally smoking dope.

*Argument from authority*

My guess is that you are largely mischaracterizing my point of view.

> Nobody can
>even understand your line of thinking; and these include people who helped
>design COM, who have written clean room JVMs, who helped design
>CORBA, and who are employed by firms both large and small.

*Argument from authority*

Nevertheless, what point of view are they having a hard time understanding?

Is it the supposed claim the OO solves all the worlds problems?  That seems
to be one of yours and Uri's favourite propositions to assign to me.  It is
not, however, my position.

> All of us
>were programmers long before 'OO methodologies' (sic) became a fad,
> The best approximation
>anyone has come up with is from a fellow who has written two OO design
>books: he generously suggests that you're using the words 'algorithms'
>and 'design patterns' to mean something they don't usually mean (in
>or outside of software engineering), and that you're trying to say that
>systems should be designed coherently.

*Argument from authority (where the authority in question is likely not even
exposed to what is really my point of view).*

We have established that I used the term algorithm incorrectly.  You can
continue to beat me with that.  The problem is not that I did not know what
an algorithm is--I provided a formal definition later that no one seems to
take exception with (there does seem to be disagreement as to what
constitutes mindlessness and what exactly substrate neutrality means, but
those are semantic quibbles).  The problem is that I hastily offered up
something as an algorithm which did not even meet the definition that I set
forth.

And as far as design patterns goes, I am damn sure I am using them in a
manner consistent with software engineering.  What sort of design patterns
are you referring to?

> Which would be so obvious
>as to be uninteresting, but that's the most charitable view.  The least
>charitable view is that you're trying to make up for a lack of something
>to say by putting out Officially Approved Buzzwords In a Random Order.


*Another attempt at argumentation by insult.*

>>>> Otherwise, you are just talking voodoo.
>>>
>>>If 99% of the world is held together by voodoo -- which it is,
>>>considering what's running your car, your microwave, your
>>>computer, your routers, your electronic musical instruments,
>>>your thermostat, and your utilities -- then maybe you should
>>>give voodoo a little respect.
>>
>>Those are small, isolated applications.  Try moving into the world of more
>>complex applications.
>
>Neither your computer, your router, or your public utilities are 'small,
>isolated applications' (sic).  Do you have any idea how many millions
>of lines of code are in Windows or Solaris, or how massively complex
>the public utility computers are?


*Supported argument*

I actually missed the computer and router bit.

I actually think Windows and other operating systems are very good examples
of how software is voodoo.  In general, these bits of software are filled
with bugs that create instability and are designed in such a way as to make
interopability difficult.

>>>I think we can forgive Uri that -- after all, you clearly don't
>>>know what it is to be a programmer.
>>
>>Another personal attack.  At least when I stated Uri does not know what
>>freedom is, it came after showing where his use of the word was absurd.
>You
>>are just simply making attacks which, in this case, is clearly not backed
>up
>>the facts.
>
>Your 'showing where his use of the word was absurd' was unconvincing
>and illogical; it merely showed that you do not believe the same things
>that he believes.  This may come as a surprise to you, but you're not
>the arbiter of objective fact.


*Supported argument that ignores other facts*

I showed how his definition of freedom equated freedom with functionality
and showed how freedom and functionality were not related concepts.  That is
objectively absurd.

>I can conclusively say that I have not found a single person willing to
>support your side of the argument amongst my collection of coworkers,
>compatriots, friends and acquaintances, a collective group owning
>about 150 years worth of OO experience, about 250 years worth of
>real world software experience, and about 20 million dollars in
>equity in successful software companies.


*Argument from authority*

Like I said, I would venture you have completely mischaracterized my
arguments.

>>>And you need to stop learning from books and try to make money out here
>>>in the asynchronous sixty-way in-the-dark firefight we professional
>>>hackers call 'trying to make a living writing software'.  We look
>>>forward to competing with you.  Not to be too cruel, but at this
>>>point, I'd take 1 Ari over 30 George Reeses.
>>
>>I make a very good living at writing software, thank you.
>
>
>I admit to great surprise.  In what field?


*Implied insult*

Business software.

--
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie"
       -Orson Welles





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

Date: Mon, 21 Sep 1998 17:15:49 -0500
From: "George Reese" <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <reAN1.1239$Ge.3826953@ptah.visi.com>


John Porter wrote in message <3606B683.2640764@min.net>...
>George Reese wrote:
>>
>> Is a barrage of insults commonly accepted in comp.lang.perl.misc as a
proper
>> form of argumentation?
>
>No one has done as much harm to your reputation as you have done
>yourself.


My reputation is fine.  People like you who throw insults at me as a means
of argument have no respect from me, so I would hardly care what your level
of respect for me is.

>> Trust me, perl programmers are not my potential
>> employers or coworkers.
>
>Oh, you're leaving the industry?  I wish you had said so sooner,
>I would have cut you a lot more slack.


No place I have worked uses perl as a matter of course.  In fact, perl comes
into play only when some third party vendor forces it on us because their
software uses it.

>> You and Uri just keep repeating the mantra that I think OO is for
everything
>> in spite of the fact that I have repeatedly stated that is not the case.
>
>No, you have consistently stated that it *IS* the case, as support
>for the notion that Python is "therefore" superior to Perl.


Please provide any quote where I have saiid this.

>If OO is not for everything (as you now appear to be admitting),
>then languages which support both OO and non-OO programming are more
>broadly useful than languages which support only OO programming.


This is a logical fallacy.

Just because perl allows programming under non-OO paradigms does not imply
that perl is the best tool for working in those paradigms.

I am saying and I have maintained all along that in an OO paradigm, python
makes more sense as it is functionally similar but more strictly OO (plus
several other things not related to this particular line of argument).

Those things for which OO is not the right solution are either small, single
developer projects for which the discussion "which language is better" is
mostly meaningless or they are for projects where neither python or perl are
good answers (real time programming).






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

Date: Mon, 21 Sep 1998 22:45:33 GMT
From: bjohnsto_usa_net@my-dejanews.com
Subject: Re: Perl & Java - differences and uses
Message-Id: <6u6kud$14u$1@nnrp1.dejanews.com>

In article <6u5o88$k6c$1@node2.nodak.edu>,
  bellings@badlands.NoDak.edu (Brent A Ellingson) wrote:
>
> Exactly WHO laments that significant parts of Perl, Python,
> Emacs, Java, most UNIX's, most LISP's, most Schemes, most C++'s,
> Win9x, WinNT, ad infinatum, are written in C?
>
> NO.  They each took the the cursed hammer in hand, and built screw
> drivers, and pipe wrenches, and table saws.
>
> NONE of them sat in a corner and swore at the damned hammer.
>
> Brent Ellingson (bellings@badlands.NoDak.edu),

Maybe they saw C not as the be all and end all of languages, but as a
portable, high level assembler with broad support.

C compilers and API's are the guts of the way you write for more than one type
of unix machine.

I suggest any other portable, high level assembler would be just as good as C.
C is a standard, that is why those creating more better languages use it as a
base.

Python is also implemented on top a Java Virtual Machine with, I presume, no
C, this along with many other things make it clear what the next standard
after C is most likely to be.

Brendan Johnston



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 21 Sep 1998 23:08:36 GMT
From: bjohnsto_usa_net@my-dejanews.com
Subject: Re: Perl & Java - differences and uses
Message-Id: <6u6m9k$2hr$1@nnrp1.dejanews.com>

It seems a bit off your topic of labor division in software engineering.

However it seems to me Knuths idea of an algorithm is arbitarily limitted.
The smarter the machine that implements the algorithm the more vague it can
be. So with the Knuth what is and is not an algorithm changes depending on
the power of computers.

> 'To me the word algorithm denotes an abstract method for computing some output
> from some input, while a program is the embodiment of a computational method
> in some language... Of course is I am pinned down and asked to explain more
> precisely what I mean by these remarks, I am forced to admit that I don't know
> any way to define any particular algorithm except in a programming language.'
> 	-- Donald E. Knuth (Communications of the ACM, vol. 9, num, 9, Sept 1966

I suggest this recipe is an algorithm (after you fix any bugs in it):

Take 1/2 pint of milk, a cup of flour and 3 eggs.
Blend the milk and the eggs and then steadily add the flour.
Ensure mixture is well mixed, remove from blender.
Put in fridge for one hour.
Remove mixture from frigde, blend again.
Melt some butter a fry pan over medium heat.
Add mixture to the pan in small amount to create thin crepes.
When the top side of the crepe is dry flip.
Remove crepe from pan when the other side is nicely down.

However it is not in a programming language and only a competentent cook could
follow it correctly.

I suggest that an algorithm is a step by step explaination of how to achieve a
goal where each step is unambiguous to the entity that performs the task.

So an algorithm for a person, may be different to an algorithm for a sql
database, which is different to an algorithm for an assembler.
But they are all algorithms.

Brendan Johnston


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 21 Sep 1998 23:28:34 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <3606DEB9.AF573BA8@bbnplanet.com>

Abigail wrote:

<--snip age old rant-on -->

> How do you think the Egyptians build their pyramids 4000 years ago?
> Every peasant was a top notch pyramid builder?

Slaves, sadistic slave drivers, a well defined plan, a protocol and the
belief that the pharoh was divinity incarnate. Possibly more inspiring
than any of modern programming. Then again, my boss brought in a bull
whip the other day.

e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: 22 Sep 1998 09:33:07 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6u6nnk$ne0$1@godzilla.zeta.org.au>

In <opyN1.1207$Ge.3737871@ptah.visi.com> George Reese <borg@imaginary.com> writes:

[...]

>That there
>be no primitives in an OO environment is a silly construct of
>misguided Smalltalk developers, not of anyone who is familiar with
>what OO is at heart

Did you just say that smalltalk developers are not familiar with what OO
is at heart?  Next thing your going to tell me is that Wruth dosn't 
understand structured programing.



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

Date: 21 Sep 1998 15:38:54 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: PerlMagick & linux
Message-Id: <obww6xgq01.fsf@alder.dev.tivoli.com>


terrazas@labmed.ucsf.edu (Enrique Terrazas) writes:
> I installed ImageMagick (ImageMagick-4.1.0-1glibc.i386.rpm) on my linux
> machine (Pentium PC running RedHat Linux 5.1) with no problem.  However, I
> can't get PerlMagick installed.  I get the following error when I try to
> "make":

did you also install the ImageMagick-dev (from memory).  You need to
also install the header files and libraries.

> cc -c -I../magick -I/usr/local/include/magick -I/usr/X11R6/include
> -Dbool=char -DHAS_BOOL -I/usr/loc
> al/include -O2    -DVERSION=\"1.45\" -DXS_VERSION=\"1.45\" -fpic
> -I/usr/lib/perl5/i386-linux/5.00404
> /CORE  Magick.c
> Magick.xs:15: magick.h: No such file or directory
> make: *** [Magick.o] Error 1
> 
> Is magick.h supposed to be installed with ImageMagick?  If so, it doesn't
> seem to be installed on my machine. 

If I remember correctly the .rpm put the header files in an odd place, 
something like /usr/include/X11R6/include/magick  either query the
 .rpm or walk your drive...  (You'll probably have to edit the
Makefile.PL file, but it's in the README)

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: Mon, 21 Sep 1998 15:33:17 -0700
From: Yogish Baliga <baliga@synopsys.com>
To: Kenneth Hunt <kchunt@mail.hac.com>
Subject: Re: problems using "use", HELP!
Message-Id: <3606D42D.1D96A58A@synopsys.com>

This seems to be the version problems.
 Try the following command :
          /usr/local/bin/perl -v

This gives the version of perl you are using. I think the perl you are using
is
not 5.x version. Since the OOP is not allowed in perl 4.x or bellow, the
error is
returned.

If the version of perl you are using is not 5.x, replace the first like with

the perl 5.x binary path.

Hope this solves your problem,

-- Baliga

Kenneth Hunt wrote:

> I'm new so be kind. I'm trying to us a module and I declare it like
> this:
>
>         #!/usr/local/bin/perl
>         #
>         #       test.cgi: template for automatic HTML generation
>         #
>
>         use CGI qw(:standard);
>
> and I get this error when I run "perl -w test.cgi":
>
>         "use" may clash with future reserved word at test.cgi line 6.
>         syntax error in file test.cgi at line 6, next 2 tokens "use CGI"
>         Execution of test.cgi aborted due to compilation errors.
>
> What am I doing wrong?
> --
>
> ------------------------------------------------------
> Kenneth Hunt
> SC S12 V321 Rm. C233
> office: 364-7755        pager:  715-0600
> ------------------------------------------------------





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

Date: Mon, 21 Sep 1998 22:36:21 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: problems using "use", HELP!
Message-Id: <3606D670.10E415AD@shaw.wave.ca>

[posted & mailed]

Kenneth Hunt wrote:
> 
> I'm new so be kind. I'm trying to us a module and I declare it like
> this:
> 
>         #!/usr/local/bin/perl
>         #
>         #       test.cgi: template for automatic HTML generation
>         #
> 
>         use CGI qw(:standard);
> 
> and I get this error when I run "perl -w test.cgi":
> 
>    "use" may clash with future reserved word at test.cgi line 6.
>    syntax error in file test.cgi at line 6, next 2 tokens "use CGI"
>    Execution of test.cgi aborted due to compilation errors.
> 
> What am I doing wrong?

Using perl 4.  It's time to upgrade!

Run perl -v to confirm.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Mon, 21 Sep 1998 16:30:28 -0700
From: Kenneth Hunt <kchunt@mail.hac.com>
Subject: Re: problems using "use", HELP!
Message-Id: <3606E194.46B93752@mail.hac.com>

> Using perl 4.  It's time to upgrade!
> 

It's a server at work. You know how that goes...3 years behind on
everything...

Thanks all for the help!
-- 


------------------------------------------------------
Kenneth Hunt
SC S12 V321 Rm. C233
office:	364-7755	pager:	715-0600
------------------------------------------------------


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

Date: Mon, 21 Sep 1998 15:26:28 -0700
From: "Vincent M. Padua" <vincent@psnw.com>
Subject: split function not working properly?
Message-Id: <3606D294.1868C0B3@psnw.com>

I'm working on a really simple perl script (newbie) and for some reason
the split function doesn't seem to woork correctly for me.  All it
returns are blanks.  Below I've noted the section of code I'm having
trouble with.  I've included the entire script in case you want to look
at it.

Thanks for your help and please CC me at vincent@psnw.com if you respond
only to the list.

Vince.

#!/usr/bin/perl

##########################Here's the Problem#######################
## on the variable passed in $_[0] it is the correct value, should be
something like 1234567.1234566
## however when I try to split it on the decimal, I get nothing but
blanks.  Can someone tell me why ## I'm getting this?

sub convert_JD {
  print "Passed in: $_[0]\n";
  $_[0] += .5;
  ($z,$f)=split /./, $_[0];
  print "Z : $z, F : $f\n";


  if ($z < 2299161)
    {
      $a = $z;
    }
  if ($z >= 2299161)
    {
      $alpha = int (($z - 1867216.25) / 36524.25);
      $a = $z + 1 + $alpha - int (alpha / 4);
    }
  $b = $a + 1524;
  $c = int(($b - 122.2)/365.25);
  $day = int(365.25 * $c);
  $e = int(($b-$day)/30.6001);
  $day_of_month = $b - $d - int(30.6001 * $e) + $f;
  print "$b : $d : $e :$f\n";
  print "Day: $day_of_month\n";
  if ($e < 14)
    {
      $month_is = $e - 1;
      print "Month: $month_is\n";
    }
  if ($e == 14 | $e == 15)
    {
      $month_is = $e - 13;
      print "Month: $month_is\n";
    }
  if ($month > 2)
    {
      $year_is = $c - 4716;
      print "Year: $year_is\n";
    }
  if ($month == 1 | $month ==2)
    {
      $year_is = $c - $4715;
      print "Year: $year_is\n";
    }
}

sub calc_lunar_phases {
  $first_quarter = .25;
  $full_moon = .50;
  $last_quarter = .75;

  $k = ($year_in_decimal - 2000) * 12.3685;
print "KKKKKK : $k\n\n";
  $T = $k / 1236.85;
print "TTTTTT : $T\n\n";
  $phase_time = 2451550.09765 + 29.54058853 * $k + 0.0001337 * $T**2 +
0.000000150 * $T**3 + 0.00000000073 * $T**4;
print "PPPPPPHase time : $phase_time\n\n";
  $frst_qt_plus_phase_time = $first_quarter + $phase_time;
  $fll_mn_plus_phase_time = $full_moon + $phase_time;
  $lst_qt_plus_phase_time = $last_quarter + $phase_time;
  print "Phase time-----------------\n"; print "Phase time:
$phase_time\n"; &convert_JD($phase_time);
 # print "First quarter--------------\n"; print "First qt:
$frst_qt_plus_phase_time\n";
 # print "Full moon------------------\n"; print "Full Moon :
$fll_mn_plus_phase_time\n";
 # print "Last quarter---------------\n"; print "last qt :
$lst_qt_plus_phase_time\n";
}

print "Please enter the date to find JD: ";
chomp($date_using=<STDIN>);
($month,$day,$year)=split /\//, $date_using;
if ($month == 1) {
  $temp_month = $day;
}
if ($month == 2) {
  $temp_month = 31 + $day;
}
if ($month == 3) {
  $temp_month = 59 + $day;
}
if ($month == 4) {
  $temp_month = 90 + $day;
}
if ($month == 5) {
  $temp_month = 120 + $day;
}
if ($month == 6) {
  $temp_month = 151 + $day;
}
if ($month == 7) {
  $temp_month = 181 + $day;
}
if ($month == 8) {
  $temp_month = 212 + $day;
}
if ($month == 9) {
  $temp_month = 243 + $day;
}
if ($month == 10) {
  $temp_month = 273 + $day;
}
if ($month == 11) {
  $temp_month = 304 + $day;
}
if ($month == 12) {
  $temp_month = 334 + $day;
}

$day_month = $temp_month / 365;
print "day_month: $day_month\n";
$year_in_decimal = $day_month + $year;
print "year in decimal: $year_in_decimal\n";
if ($month == 1 || $month == 2)
  {
    $year = $year - 1;
    $month = $month + 12;
  }

&calc_lunar_phases;



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

Date: Mon, 21 Sep 1998 17:49:20 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: split function not working properly?
Message-Id: <3606D7F0.47736454@gpu.srv.ualberta.ca>

Vincent M. Padua wrote:
> 
> I'm working on a really simple perl script (newbie) and for some reason
> the split function doesn't seem to woork correctly for me.  All it
> returns are blanks. 

its working ...

[snip]

>   ($z,$f)=split /./, $_[0];

reread the docs on split, 'perldoc -f split', and perhaps review
regular expressions 'perldoc perlre' --- your pattern is /./, 
recall that a dot is special in a regex pattern, it matches a 
lot more than just a dot :-)

($z,$f)=split /\./,$_[0];

hope it helps 
regards
andrew


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

Date: Mon, 21 Sep 1998 23:10:10 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: split function not working properly?
Message-Id: <3606DA68.64DFE8FB@bbnplanet.com>

Vincent M. Padua wrote:

> I'm working on a really simple perl script (newbie) and for some reason
> the split function doesn't seem to woork correctly for me.  All it
> returns are blanks.  Below I've noted the section of code I'm having
> trouble with.  I've included the entire script in case you want to look
> at it.

<--snip-->

> ($z,$f)=split /./, $_[0];

  ($z,$f)=split /\./, $_[0], 2;

perldoc -f split
Metachars need to be escaped and using a limit (2) is a helpful habit to
getting into.

> ($month,$day,$year)=split /\//, $date_using;

You might also want to use 'my' here unless you are using these
throughout. My eyes were squinting to read your code too hard possibly.

BTW - check out CPAN for the Time::JulianDay module. Dunno if there is a
lunar one out there but you might check for that too.


e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: Mon, 21 Sep 1998 15:35:37 -0700
From: Yogish Baliga <baliga@synopsys.com>
To: nguyen.van@imvi.bls.com
Subject: Re: Using perl module
Message-Id: <3606D4B8.3C84BCFA@synopsys.com>

Yes.. You do need to mention the path in which this file is residing. But the
variable
you are supposed to mention this is not PATH but it is PERLLIB.

Good Luck,
-- Baliga

nguyen.van@imvi.bls.com wrote:

> Hi guys,
>
> I downloaded a certain module.pm, but to use it do I need to set PATH in my
> .profile so that my program know where the modules are?
>
> Thanks
> Van Nguyen
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum





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

Date: 21 Sep 1998 16:14:49 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: where is Date::Parse (CPAN.pm)?
Message-Id: <yl7lyxf47q.fsf@windlord.stanford.edu>

Honza Pazdziora <adelton@fi.muni.cz> writes:
> On 20 Sep 1998 12:38:36 -0700, Russ Allbery <rra@stanford.edu> wrote:

>> Nothing's going to work perfectly with everything, and in fact
>> nothing's likely to work as well across all Perl modules as CPAN.pm.
>> However, CPAN.pm fails miserably for anything that's *not* a Perl
>> module, and I'm

> But it's not CPAN.pm's fault, it's a problem with CPAN itself. The
> non-module things are not indexed, and you cannot hope to solve the
> problem before you have the primary data you can build on, isn't that
> true?

Yes, but I'm making an even more general point than that.  I also have to
manage an installation of emacs.  And fileutils.  And vim.  And X.
And....  CPAN.pm is great for Perl modules, but I need a general solution
to the general problem, not individual packaging structures for each
little piece.

(And before someone mentions it, looked at RPM, tried it, it's not
sufficient, will attempt to write up the reasons why it's not sufficient
for the benefit of the RPM folks at some point and haven't had the time.)

-- 
#!/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: 21 Sep 1998 23:01:38 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: where is Date::Parse?
Message-Id: <6u6lsi$7dg$1@client3.news.psi.net>

Honza Pazdziora (adelton@fi.muni.cz) wrote on MDCCCXLVII September
MCMXCIII in <URL: news:slrn70de85.o6k.adelton@aisa.fi.muni.cz>:
++ On 21 Sep 1998 16:39:47 GMT, Abigail <abigail@fnx.com> wrote:
++ > 
++ > It's just a plain stupid and dumb piece of code. To frustrating
++ > to work with. 
++ 
++ Why don't you just offer patches? Or have you got a complete new
++ piece of code that allows at least the same functions as CPAN.pm
++ does?


*ponder*

What functionality is in CPAN you can't get with "ftp", "tar", "zcat",
"less", "make", and basic reading skills?




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: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 3780
**************************************

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