The distinctive Perl camel is (c) O'Reilly
Perl Workshop Home Page
Home of the Bioinformatics Perl Workshop perl workshop > courses > introduction to perl (1.0.1.8) > Lists, Arrays and Context (.3/8) > grow (.c1)

course 1.0.1.8

Level: beginner
1.0.1.8.3
Introduction to lists and arrays; manipulating arrays; scalar vs array context. BCCRC Lecture theatre.

legend

course code

cat.course.level.sessions.session

e.g. 1.0.1.8

categories

0 | introduction and orientation

1 | perl fundamentals

2 | shell and prompt tools

3 | web development

4 | CPAN Modules

5 | Ruby

levels

level: all all ( 0 )

level: beginner beginner ( 1 )

level: intermediate intermediate ( 2 )

level: advanced advanced ( 3 )

[ consider using for instead of foreach ]

lecture code viewer

downloads

Code
Lists, Arrays and Context
Lists, Arrays and Context
Martin Krzywinski
#!/usr/local/bin/perl use Data::Dumper; # new line at the end of each print, automatically $\ = "\n"; @x = (); $x[0] = 1; $x[1] = 2; $x[-1] = 3; print Dumper(\@x); $x[3] = 4; print Dumper(\@x); @y = (); $y[5] = 5; print Dumper(\@y); @z = (1..5); @w = (1..5); print $#w; $#w = 5; print Dumper(\@w); $#w = 3; print Dumper(\@w); $#w = 5; print Dumper(\@w); print a..z;

3 | Lists, Arrays and Context | 1.0.1.8.3

1.0.1.8.3.p1 | Lists, Arrays and Context | Martin Krzywinski | ppt
1.0.1.8.3.c1 | grow | Martin Krzywinski | code
1.0.1.8.3.c2 | iteration | Martin Krzywinski | code
1.0.1.8.3.c3 | pop | Martin Krzywinski | code
1.0.1.8.3.c4 | push | Martin Krzywinski | code
1.0.1.8.3.c5 | swap | Martin Krzywinski | code
1.0.1.8.3.a1 | Lists, Arrays and Context | Martin Krzywinski | pdf
1.0.1.8.3.s1 | Lists, Arrays and Context | Martin Krzywinski | slides