Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Perl Babysteps 1: Your First Simple Script

by Juerd (Abbot)
on Dec 30, 2004 at 09:04 UTC ( #418220=note: print w/ replies, xml ) Need Help??


in reply to Perl Babysteps 1: Your First Simple Script

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # hello.pl # Displays a warm greeting. # # AUTHOR # Brian Wisti (or webfiend on perlmonks) # DATE # 28 December 2004 # VERSION # 1.0 # PURPOSE # Demonstration script for my Perl tutorial # USAGE # perl hello.pl # LICENSE # You may copy and redistribute this program as you see fit, with n +o # restrictions. # WARRANTY # This program comes with NO warranty, real or implied. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

You meant

=head1 NAME hello.pl - Displays a warm greeting. =head1 USAGE perl hello.pl =head1 DESCRIPTION Demonstration script for my Perl tutorial =head1 LICENSE You may copy and redistribute this program as you see fit, with no res +trictions. =head1 WARRANTY This program comes with NO warranty, real or implied. =head1 AUTHOR Brian Wisti (or webfiend on perlmonks)
and the version in the package global $VERSION, I hope.

Don't document in comments. See also POD in 5 minutes. It's not scary.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }


Comment on Re: Perl Babysteps 1: Your First Simple Script
Select or Download Code
Re^2: Perl Babysteps 1: Your First Simple Script
by Mr. Muskrat (Abbot) on Dec 30, 2004 at 16:40 UTC

    And it's easier to teach one thing early on and expand that knowledge later. If you teach to much, they will not retain the information.

    For example, on day one you show them comments.

    "Comments begin with the hash (or octothorpe) character."

    # I am a comment!

    And leave the POD for a later day...

    "Today we will learn about POD. POD is short for Plain Old Documentation and it is a fairly simple way of documenting your code. We'll begin by adding a heading to your existing project and then cut back to the code."

    package Beginner::Project; use strict; use warnings; # may or may not be lots of code here =head1 NAME Beginner::Project - a project worthy of a beginner Perl programmer =cut # your code continues here... 1;
Re^2: Perl Babysteps 1: Your First Simple Script
by webfiend (Vicar) on Dec 30, 2004 at 19:16 UTC

    It's scary for the people I'm writing to :-) Tutorials like these are for my dad or brother, who have never fiddled with another programming language for more than a few minutes. The script header bit is just getting them into the habit of documenting in the first place. I agree that once they're ready for POD, they should switch over. But as it is, I'd have to explain POD, formatting, perldoc, and package global variables (which means I'd have to at least glance at packages and scoping).

      Tutorials like these are for my dad or brother, who have never fiddled with another programming language for more than a few minutes.

      Is this how you talk to your dad? And isn't that they don't aspire becoming programmers the reason for not having fiddled with programming languages? Are they, for some reason, unable to read books like Beginning Perl?

      Anyway, I recommend that you let them read a good existing tutorial. It saves you a lot of time, this monastery weird tutorials and lets your dad and brother learn Perl without getting to think programming is for teletubbies. I suggest http://www.steve.gb.com/perl/tutorial.html.

      Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://418220]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-07-25 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls