1820658 Members
2486 Online
109626 Solutions
New Discussion юеВ

Perl Info

 
SOLVED
Go to solution
Tom Jackson
Valued Contributor

Perl Info

Hi:

I would like to learn perl. Are there any good books? I like overviews and examples. Any good web resources? Besides this forum, of course.

Tom
30 REPLIES 30
Robert-Jan Goossens
Honored Contributor
Solution

Re: Perl Info

Hi Tom,

Here is a good link to start.

http://learn.perl.org/

Hope it helps,

Robert-Jan.
Pete Randall
Outstanding Contributor

Re: Perl Info

Hi Tom,

There's lots of great ideas and suggestions for you in this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x27308f960573d611abdb0090277a778c,00.html

Good luck,
Pete

Pete
Vincent Stedema
Esteemed Contributor

Re: Perl Info

Hi,

Learning Perl and Programming Perl are excellent books from O'Reilly. Pick up Learning Perl if you're completely new to Perl.

If you don't want to buy a book and already have Perl installed on your system, then:

#perldoc perlfaq

will get you started.

Regards,

Vincent
Vincent Stedema
Esteemed Contributor

Re: Perl Info

Hi,

Do a find on all perl*.pod files in your PERL5LIB directories. If you want more info on the command line options, use "perldoc perlrun".

Regards,

Vincent
Tom Jackson
Valued Contributor

Re: Perl Info

Hi Again:

I'm running HPUX 11i and I guess I have it. I can do a "perl -h" to get the command options. However, "man perl" and "perldoc perl" don't work. Any thoughts?

I'll award points a little later so others can get in on the thread so I can award Christmas points to all!;)

Thanks for the tips so far!

Tom
Chris Wilshaw
Honored Contributor

Re: Perl Info

You may just have the basic (old) installation which is located in /usr/contrib/bin, which doesn't include the docs etc.

The latest version can be installed from the Applications CD's (CD 5 I believe). No codeword is required for the installation.
Shannon Petry
Honored Contributor

Re: Perl Info

I have programming perl, learning perl, and perl for the web programming by O'Reilly and Associates. One of the best books I have found is strangely not published by O'Reilly. It is "Perl 2nd Edition Black Book", published by Coriolis.

Regards,
Shannon
Microsoft. When do you want a virus today?
Ralph Grothe
Honored Contributor

Re: Perl Info

Hi Tom,

first regarding good books on Perl.

Generaly I would say any book from O'Reilly that covers Perl (you can easily identify them by their light blue backs) is an investment not in vain.

If you're new to Perl I would recommend "Learning Perl" (aka the Lama Book) by Randal Schwartz (a veteran Perl guru), as others already have.

If you already know a little of Perl, and only need lots of explained code examples how things are done in Perl (meaning the really Perlish way), then the "Perl Cookbook" (i.e. the one with the ibex on the cover) is an excelent choice.

If you're after a good entertainig read then "Programming Perl" (aka the Camel Book) is nice to have.

If you know the basics in Perl and look forward to become a Perl expert then I'd suggest

"Effective Perl" (also by Randal Schwartz)
Object Oriented Perl (by Damian Conway)

But in general you don't need any books since the POD is always with you.

If the shell says "not found" when you issue "perldoc perl" it might only not be in your PATH.
Usually on HP-UX the rather dated Perl 4 from /usr/contrib/bin sneaks in.
So you have to make sure your grown Perl (viz. something >= release 5.X) comes in your PATH before /usr/contrib/bin gets a chance.
Or you set a symlink as root from /usr/bin.

You could check if

swlist perl

finds a prebuilt and installed HP-UX depot on your box.
If so this will show you where it got installed:

$ /usr/sbin/swlist -a file perl.perl-RUN|head

Usually under /opt/perl5 or /usr/local/perl*

Otherwise you would have to install Perl either from the HP-UX Application CDROM set (see CD_TABLE_OF_CONTENTS to find the propper disk)
or better grab the stable.tar.gz tarball from
http://www.cpan.org/

You need an ANSI C compiler to build Perl from the sources.
(best the one sold for HP-UX, or gcc)
The compilation of Perl on HP-UX has some tweaks, especially if you want to use DBD::Oracle later.
So carefully study the README.hpux from the tarball.


Madness, thy name is system administration
Tom Jackson
Valued Contributor

Re: Perl Info

Hi again:

Thanks for the great replies.

Well, I ordered Learning Perl, Third Edition and Programming Perl (3rd Edition) from O'reilly. I also have Perl Black Book, Second Edition in my Books24x7.com. This should keep me busy for a little while.

However, I'm confused with the perl that is installed on my J6000. It doesn't show up in swlist. "man perl" and "perldoc perl" don't work. Is this only a problem if I need local doco? The only thing I found on my system was the /usr/contrib/bin/perl executable.

I also can't find perl on my 11i applications CDs (I have three application CDs).

I don't have HP's ANSI C, but I have gcc 3.0.2, but I would rather not build from source. Too much trouble in the past building other packages.

Any more direction?? More points to be awarded!

Tom
Ralph Grothe
Honored Contributor

Re: Perl Info

Looks as if a current Perl isn't installed on your box. :-(

You may get a pre-built binary depot from the HP-UX porters:

http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.8.0/

I'm sure that a recent Perl is also on the Core OS as well as on the Application CDs for 11i, but can't get access to one CD set now (locked in the cupboard of a colleague)

Even after you have installed Perl yourself it could be that you have to include the bin subdir of your installation target in your PATH.

After that you can run a find over the Perl installation target, and grep for suffix .pm to see what modules got installed.

e.g.

$ find /opt/perl5/ -type f -name \*pm|head
/opt/perl5/bin/pl2pm
/opt/perl5/lib/5.6.1/AnyDBM_File.pm
/opt/perl5/lib/5.6.1/AutoLoader.pm
/opt/perl5/lib/5.6.1/AutoSplit.pm
/opt/perl5/lib/5.6.1/Benchmark.pm
/opt/perl5/lib/5.6.1/CGI.pm
/opt/perl5/lib/5.6.1/CGI/Apache.pm
/opt/perl5/lib/5.6.1/CGI/Carp.pm
/opt/perl5/lib/5.6.1/CGI/Cookie.pm
/opt/perl5/lib/5.6.1/CGI/Fast.pm

Or if you like it more obfuscated (viz. Perlish ;-) run this command to have Perl do the find:

perl -MConfig -MFile::Find -e 'find sub{push @m,$1 if/(\w+)\.pm$/&&!$s{$1}++},$Config{privlib};END{print join"\n",sort @m}'|more

Madness, thy name is system administration
Pete Randall
Outstanding Contributor

Re: Perl Info

Tom,

Try Procura's page on beepz (if you can connect to it):

https://www.beepz.com/personal/merijn/#Statistics


He's got all kinds of goodies.


Pete

Pete
Steven E. Protter
Exalted Contributor

Re: Perl Info

O'Reilly's Perl Cookbook

Tom Christiansen & Nathan Torkington.

After you learn the basics.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tom Jackson
Valued Contributor

Re: Perl Info

Hi:

One more question:

I went to the HPUX Porting and Archive center and they have three flavors:

HP-UX 11.00 PA-RISC Binary Depot (gzipped)
HP-UX 11.20 IPF Binary Depot (gzipped)
and HP-UX Source Code Tar Image (gzipped)

As I mentioned before, I don't want to build the binary if I don't have to. Will the HP-UX 11.00 PA-RISC Binary Depot (gzipped) version work on my HPUX 11.11 box?

Tom
Pete Randall
Outstanding Contributor

Re: Perl Info

Tom,

Yes, it should.

Pete

Pete
Tom Jackson
Valued Contributor

Re: Perl Info

Hi:

Sorry to bail out, but I need to pick up my sick son from school.:(

I'll pick back up tomorrow am.

Thanks again,

Tom
Pete Randall
Outstanding Contributor

Re: Perl Info

Tom,

Minor correction to that link I gave you:

https://www.beepz.com/personal/merijn


Pete

Pete
Kelli Ward
Trusted Contributor

Re: Perl Info

Hi Tom,
There is a newer book called Debugging Perl you could check out.

Also, here is a pretty decent little freebie called Picking UP Perl

Happy Holidays
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
Steven E. Protter
Exalted Contributor

Re: Perl Info

Woohoo!

Earned my graduate's cap...

503.

Whoohoo!

Hope it helps, perl is wonderful, powerful, procedural language.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
H.Merijn Brand (procura
Honored Contributor

Re: Perl Info

Been away for only one day, and come back to read all those warm and positive opinions about my favorite language makes me happy :)

three direct or inderect references to my input (README.hpux is mine too) is an award in itself.

Tom, personally, I've learned most from reading scripts, not books. Books show syntax and semantics, scripts show solutions to known problems. Once you can read and understand Perl, try "The Perl Cookbook" from O'Reilly. It has lots of working solutions in scriptform.

All mentioned links are great, but all you left out one important link for when you have perl running: http://search.cpan.org which you need to find missing modules. Do not re-invent the wheel, use what's available.

Whatever book you choose, they are *always* outdated. perl documentation is updated on a daily basis, as are the README's. README.hpux is available as manpage after installation as 'man perlhpux'. There's a bunch of people that try to keep the latest perl documentation in sync with http://perldoc.cpan.org/

Public available perl's are built with gcc (mine with gcc-3.2). Please note that if you have HP C-ANSI-C on your machine, consider to rebuild perl from scratch, because gcc builds are up to 25 % slower than HP's C builds. Here you can specify yourself if you need 64bit (you probably don't) or Oracle (in doubt? Yes you do, because you cannot add it later, and you will have to rebuild *all* from scratch :)

Chris, /usr/contrib/bin is perl version 4.036. Very old and unusable except for some very basic tasks. All the books Tom just ordered deal with perl5.

Ralph, good summary!

Pete, always beat me in posting my own link, do you? FWIW it's one page only, so if you start with #Statistics, you can find the perl sections too.

Tom, for 11i you need the correct architecture, that's all. Don't try the IPF if you are running on PA-RISC or vise versa. ANd best wishes for your son.

Steven, congrats.

Enjoy, have FUN!
H.Merijn
Enjoy, Have FUN! H.Merijn
Tom Jackson
Valued Contributor

Re: Perl Info

Pete:

I'll install the 11.0 binary today. Thanks.

Kelli:

Due to the tight economy, I can't expense books, the $ comes out of my pocket. Is dubugging perl a must have? Or can I get by without it for a while. I just ordered the two most popular books (from this forum) and I'm hoping this will suffice. At least for a while.

However, I do have access to Books24x7.com. Unfortunately the Perl Cookbook isn't listed. Does anyone else use Books24x7? If you do and their are some unix/HPUX/Perl/J2EE must reads, pleaqse let me know!:)

One more thing Kelli. I couldn't open you freebie?? I get "An error has occurred trying to use this document." And my browser panel is blank.

Steve:

You crank! Congrats on you second speedy hat;)

Procura:

Sounds like You are the master. And I am the grasshopper (ever watch Kung-Fu? 70's show about martial arts). Anyway, thanks for the links and explanation. Sounds like I'm entering a fresh, new programming world. I like it!

You are correct, the perl executable is in /usr/contrib/bin. However, when I do a perl -v I get:

This is perl, version 5.005_02 built for PA-RISC1.1

Copyright 1987-1998, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

I'm still a bit confused about what I have. Guess it doesn't matter since I'm re-installing. swlist|grep -i gcc shows:
gcc64 3.0.2.2001-11-14 GCC

Do I need a more recent version (3.2)? Should I rebuild perl with my 3.0.2 gcc, with the 3.2 version, or just load the binary depot like I was planning? I have an Oracle 8.0.5 database that runs on an NT server. My HP makes JDBC calls to the DB.

I have a PA-RISC, O.K. I'll go with the PA-RISC version. What is IPF?

My son is doing fine. He had an upset stomach yesterday. He was supposed to be in a kindergarten Christmas show singing songs. Maybe he got a bit nervous. He seems fine. Thanks for the concern.

Thanks again to ALL!

To
Pete Randall
Outstanding Contributor

Re: Perl Info

Tom,

IPF = Itanium Processor Family

Glad to hear your son's OK.

Have a Merry Christmas.


Pete

Pete
H.Merijn Brand (procura
Honored Contributor

Re: Perl Info

Strange. /usr/contrib/bin/perl updated? to 5.005_02? Hmmmm. Whatever you will use, please try to run at least 5.6.1, or 5.8.0 if you *need* 64bit or Unicode.

Show us 'which perl'

Your gcc is a 64bit gcc, and with that I mean 64bit only. This gcc cannot create 32bit objects. This will ruin your day if you need modules that only run in 32bit mode (yes, there are still quite a few around), or if you need to link to 32bit applications like Oracle/32bit. Oracle needingness might force you to rebuild perl from scratch (or fetch my build from https://www.beepz.com/personal/merijn). 3.0.2 ain't bad, but 3.2 is *much* better.


If all goes well, there might be a mirror of my beepz page available soon, since Clemens has offered me some disk space!
Enjoy, Have FUN! H.Merijn
Tom Jackson
Valued Contributor

Re: Perl Info

Hi Procura:

which perl produces:

/usr/contrib/bin/perl

Version 5.8.0 binary is available from the HPUX Porting and Archive Center.

perl 5.8.0 prepared for Oracle + DBI 1.30 +Tk 800.024 built with gcc-3.2 is available from beepz.

It sounds like the beepz version has more stuff in it. Is this true? Or are there some differences that may cause problems?

Tom
H.Merijn Brand (procura
Honored Contributor

Re: Perl Info

Not very likely. My port is built on 11.00, HP's is (probably) built on 11i.

On beepz, the gcc with which I built that perl is also available (but still built on 11.00)

My port is more stuffed with modules used in applications, where the HP port is accompanied with network modules.

My port has precompiled DBI and Tk, both lacking in HP's port. It's up to you.
Enjoy, Have FUN! H.Merijn