How to learn Perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to learn Perl
# 8  
Old 10-30-2002
Here is a downloadable version of Perl tutorial in PDF or HTML.

http://www.ebb.org/PickingUpPerl/

******
BTW, I get several errors when I try to run perl on my systems. Here is the program.

# cat myprog.pl
#!/usr/contrib/bin/perl

use strict; # important pragma
use warnings; # another pragma
print "What is your username? "; # print out question
my $username; # "declare" a variable
$username = <STDIN>; # ask for a username
chomp($username); # remove "new line"
print "Hello, $username.\n"; # print out the greeting

*** Here are the errors.


# ./myprog.pl
Can't locate strict.pm in @INC (@INC contains: /opt/perl5/lib/5.00502/PA-RISC1.1
/opt/perl5/lib/5.00502 /opt/perl5/lib/site_perl/5.005/PA-RISC1.1 /opt/perl5/lib
/site_perl/5.005 .) at ./myprog.pl line 3.
BEGIN failed--compilation aborted at ./myprog.pl line 3.

*****
Here is my version of PERL.

# perl -v

This is perl, version 4.0

$RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
Patch level: 36

Copyright (c) 1989, 1990, 1991, 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 4.0 source kit.




Smilie

Last edited by Kelam_Magnus; 10-30-2002 at 11:55 AM..
# 9  
Old 10-30-2002
My favorite site for perl type info is http://www.perlmonks.com/.
# 10  
Old 10-30-2002
Quote:
Originally posted by Kelam_Magnus

# ./myprog.pl
Can't locate strict.pm in @INC (@INC contains: /opt/perl5/lib/5.00502/PA-RISC1.1
/opt/perl5/lib/5.00502 /opt/perl5/lib/site_perl/5.005/PA-RISC1.1 /opt/perl5/lib
/site_perl/5.005 .) at ./myprog.pl line 3.

*****
Here is my version of PERL.

# perl -v

This is perl, version 4.0

Smilie [/B]
1) update your perl version. use the most current stable 5.8 i believe and your problem is solved.

2) according to your error your version of perl does not have the perl module for strict installed.

you can get perl modules from www.cpan.org very easy to use and navigate after you familurize yourself with the site.

also note that you should use #!/usr/bin/perl -w

when perl is installed it installes the binarys in a few locations and one copy is in /usr/bin. the -w switch is the warnings switch. just a bit easier instead of defineing the use warning; pragma
# 11  
Old 10-30-2002
Thanks Perderabo, it works now. Although I don't need the strict or warning lines, they err out.

My latest version available for HPUX from my internal depot is:

perl B.5.6.1.C Perl Programming Language

here's what I get after loading.
# perl -v

This is perl, version 5.005_02 built for PA-RISC1.1
# 12  
Old 10-31-2002
[hostname]/home/i_am_anti_coolness$perl -v

This is perl, v5.8.0 built for sun4-solaris

I can only assume you checked the actual homepage of perl for the most current stable release?

either way 5.6 i know has the strict.pm (solaris 8 by default ships w/ 5.4 which has strict.

http://www.perl.com/pub/a/language/i...re.html#stable
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Book to learn Perl

Hi guys, which book are you raccomand to start learn Perl from the ground ? (1 Reply)
Discussion started by: solaris_user
1 Replies

2. Shell Programming and Scripting

How much bash to learn compared with Perl?

Hello Everyone! I am somewhat new to Unix command line and don't have much experience to input on the matter so I wanted to gather some opinion's from people who have been down the road already. Currently, I am going through a book by John Muster called "Unix Made Easy". I have gone... (2 Replies)
Discussion started by: budfoxcat
2 Replies

3. UNIX for Dummies Questions & Answers

To learn PERL

Hi, Would like to learn PERL, can anyone let me know what are the useful sources... any links... good books for the beginners to start and practice? Many thanks. (3 Replies)
Discussion started by: venkatesht
3 Replies

4. Shell Programming and Scripting

Any book to learn perl scripting

Hi, Please suggest me any good book to learn pearl scripting. Thanks in advance !!!!:) (5 Replies)
Discussion started by: vkvishwakarma6
5 Replies

5. UNIX for Dummies Questions & Answers

I Want to Learn HP-UX!

What's the best free system to learn HP-UX on? The closest system, hardware requirements and installation instructions. I'm a newbie but determined. Any tips would be great. (6 Replies)
Discussion started by: networkguy
6 Replies

6. Shell Programming and Scripting

Looking to learn perl

What do you suggest for someone that doesn't have any programming experience and want to learn perl? (3 Replies)
Discussion started by: bbbngowc
3 Replies

7. Programming

Learn C or C++

Hi, Apologies if this question has been asked before. I would like to know which language is better to learn in terms of programming in unix? is C dying out and being replaced by C++ or is it a combination of the 2 or just mainly C? Thanks C19 (2 Replies)
Discussion started by: c19h28O2
2 Replies

8. UNIX for Dummies Questions & Answers

I want to learn!

Hiya, yes im new to all of this! But want to learn how to use Unix etc, iv been thinking about doin a course but desided im better off learning by my self with help from the people who really no what there doin...you guys! I can install Linux, like redhat, mandrake, susie server edition and so... (5 Replies)
Discussion started by: epic.admin
5 Replies

9. Shell Programming and Scripting

Where do I start to learn PERL?

Hello, What is the best way to start learning PERL? Are there any "learn-it-yourself" websites? Beginner books? etc... Thanks, Barbara (3 Replies)
Discussion started by: blt123
3 Replies

10. Shell Programming and Scripting

Where can I learn Perl?

Can someone please post a link to site that teaches perl? (2 Replies)
Discussion started by: DISTURBED
2 Replies
Login or Register to Ask a Question