wood burning stoves 2.0*
The moose likes Perl and the fly likes What about perl? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Perl
Bookmark "What about perl?" Watch "What about perl?" New topic
Author

What about perl?

Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
It seems this section's description has neglected perl... why? Perl Object Oriented Programing (or POOP for short) is quite effective... If you're going to mention python, why not perl? I'd certainly be watching posts here night and day... Perl is my second favorite programming language. (My first being java of course). And don't say POOP doesn't support inheritance, that's just foolish.

Just a thought from a huge perl fan,
Cheers!
Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
and I'd jump on any perl questions posters might have.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Last time i read about OOP, i remember reading that Perl does support inheritance - are'nt the super/base classes specified in an array in a perl module..i dont remeber the name of the array though..had some wierd name ?

Also remember the book mentioning that OOP in perl is more of an after thought rather than 'by design'?...probably thats why the moderator did'nt choose to add perl in the list
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

There's a lot of poop at JavaRanch -- check out back behind the Pig Pen.


[Jess in Action][AskingGoodQuestions]
Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
Then why not bring it to this forum? It's as oop capable as python... with alot of additional plusses.

Humbly,
-D.P.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18531
    
  40

Originally posted by Daniel Prene:
Then why not bring it to this forum? It's as oop capable as python... with alot of additional plusses.

Humbly,
-D.P.


I am also a big fan of Perl. Great language to churn out quick and dirty code. IMO, I think there are tons of people here who favor Perl.

My guess is that Groovy, Python, and Ruby, are mentioned, less due to popularity, and more due to its relationship / integration with Java.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Actually Perl is mentioned - it's included in the "etc."! Did you expect us to enumerate *all* of the OO scripting languages out there?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18531
    
  40

Originally posted by Ilja Preuss:
Actually Perl is mentioned - it's included in the "etc."! Did you expect us to enumerate *all* of the OO scripting languages out there?


For some reason, I am reminded of the Professor and Mary Ann...

Henry
Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
Did you expect us to enumerate *all* of the OO scripting languages out there?

Just the good ones...
Sorry for causing trouble, thank you for atvleast reading my post...
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
And don't forget the main reson for not explicitly mentioning perl: There are a ton of web sites dedicated to perl. The great majority of perl questions will likely have already been answered at some of these other places.

Of course; if you value the famous Java Ranch friendliness and don't mind getting answers from people who mostly work in other languages - ask away!


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1006
    
    3
Originally posted by Karthik Guru:
Last time i read about OOP, i remember reading that Perl does support inheritance - are'nt the super/base classes specified in an array in a perl module..i dont remeber the name of the array though..had some wierd name ?

Also remember the book mentioning that OOP in perl is more of an after thought rather than 'by design'?...probably thats why the moderator did'nt choose to add perl in the list


Mmmmmm.... Obj Ori Perl.

Perl Support for Inheritance:
If you define the @ISA list for a package (class), any sub (method) calls that aren't handled explicitly by the current package, are searched for in the packages listed in the package's @ISA list.



Ok, that was fairly straightforward. But why is @ISA a list instead of a scalar? To support multiple inheritance.

One last "feature" is the AUTOLOAD sub. If you try to call a sub that isn't defined in a package or any of its @ISA packages, the AUTOLOAD sub is tried in each of those.

Frinstance,
Let's say...
- There's "base" packages A and B
- package C has @ISA=("B");
- package D has @ISA=("C", "A");

You try calling foo() on a D. Perl will look for the following subs:
- D::foo
- C::foo
- B::foo (depth first up the inheritance tree)
- A::foo
- UNIVERSAL::foo
- D::AUTOLOAD
- C::AUTOLOAD
- B::AUTOLOAD
- A::AUTOLOAD
- UNIVERSAL::AUTOLOAD

This setup allows any number of labor saving conventions.
[ December 07, 2005: Message edited by: Ryan McGuire ]
 
Don't get me started about those stupid light bulbs.
 
subject: What about perl?
 
Similar Threads
WA #1.....word association
Why and How Java is better than C#?
invader zim
Groovy Vs Jython Vs Jruby Vs Parrot
I have nothing to say to this