Re: Learning Perl



"EB" == Elizabeth Barnwell <elizabethbarnwell@xxxxxxxxx> writes:

EB> Here is a set of flashcards our developers have been using to learn
EB> Perl with very good results:

EB> http://www.yoyobrain.com/subjects/show/3121

EB> Add the subject to your study materials, click on try a learning
EB> drill.

i will have to take a peek as i do with most proffered perl web
tutorials.

EB> This is an example of one person's study materials, but you can make
EB> your own as well. We are adding features to the site to allow users to
EB> comment on existing content/build learning material together/attribute
EB> content to various sources. With this, we're hoping that the quality
EB> of the information will improve, providing a resource to the
EB> community.

the problem is that most learning users of perl don't know enough perl
or how to teach to explain things correctly and with enough depth and
coverage.

Operator to force a list into scalar context

ok, that is classicly wrong. there is no such thing as a list in scalar
context. it should be an array, not list.

these flash cards don't seem to be useful IMO. they are not deep enough
and there is no explanations of anything, just a simple question and
answer. there could be links to the docs, more info in each answer,
better grouping of questions, etc.

Syntax for looping through the values in a list
foreach $var @array {
}

that should be my $var.

Operators to add and remove items from the beginning of array
unshift(@array, new_item)
shift(@array)

what is new_item? unless that is a predeclared sub with a prototype it
is illegal. and it doesn't mention unshift takes a list. nor does it say
which function adds or removes (sure they are in the order mentioned in
the question but it should be pointed out. the same is true for the
push/pop slide.

the slides always say operator for what most call functions. sure they
are operators in some sense (they don't always need parens) but it is
poor terminology to always say operator.

When using qw how do you include the characters in strings that
you are using for qw delimiter
escape them with backslash

qw! string\!1 string\!2 ....!

wow. i can't recall ever needing to escape inside a qw! and most qw's
use matched delimiters or maybe //. no one uses ! !!!

When using qw (quote word) shorcut what other symbols can be
used as the delimiter besides ( )

any

qw# string1 string2 #
qw! string1 string2 !

another wow. explaining about alternate delimiters in general (given the
8 or so ops that support them) would be better. this is why this single
question flash card thing is not a good idea IMO. it stresses studying
for the test (like an MSCE!) and not deeper understanding.

What is the syntax for a list literal
( value1, value2, ....)

huh? that is a list. literals are possible values in the list.

What is the effect of using negative number for an array index
it starts counting from the end of the array backwards

that is from the department of redundant answers department.

How do you access an element in an array
use [ ]
x[3];

i see a syntax bug there!

What value do variables hold until defined
undef

hmm. do arrays and hashes hold undef? that should be scalar variables.

Comparison operator for numbers
==

hmm, i wonder what >, <, >= and <= have to say about that?
s/Comparison/Equality/

How are all numbers stored interally by Perl
double-precision floating-point values

hmm, i wonder what IV's have to say about that?


How can you run Perl with warnings enabled
-e
perl -e program_name

whoops!! that flash card should be flashing red!

so as you can see, this site needs plenty of fixes and editing and it
doesn't seem to be too helpful. simple questions like these is not the
way to learn programming in any language.

uri

--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
.



Relevant Pages

  • Re: Learning Perl
    ... it should be an array, ... Then they'd be completely inaccessible to beginners. ... that should be my $var. ... so why is it redundant to point out that Perl is different from C here? ...
    (comp.lang.perl.misc)
  • Re: perl vs Unix grep
    ... variable indexCount on array and reintialized evry time. ... Perl is langauge to make things work at any cost. ... > grep but the shell scripts that use ... As far as I can tell from reading and research ...
    (comp.lang.perl)
  • FAQ 4.42 How can I tell whether a certain element is contained in a list or array?
    ... comes with the standard Perl distribution. ... How can I tell whether a certain element is contained in a list or array? ... used a hash, not a list or array, to store your data. ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ...
    (comp.lang.perl.misc)
  • FAQ 4.42 How can I tell whether a certain element is contained in a list or array?
    ... comes with the standard Perl distribution. ... How can I tell whether a certain element is contained in a list or array? ... used a hash, not a list or array, to store your data. ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ...
    (comp.lang.perl.misc)
  • Re: delimited data into nested array
    ... > file) into Perl as a two dimensional nested array. ... not declared your variables and enabled strictures. ... Here you are using symbolic references, ...
    (comp.lang.perl.misc)