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) > Text Manipulation and Regular Expressions (.2/8) > sequence (.c7)

course 1.0.1.8

Level: beginner
1.0.1.8.2
Manipulating text with join, split and substr; introduction to regular expressions. ECHELON Lunchroom 5th floor.

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
Text Manipulation and Regular Expressions
Text Manipulation and Regular Expressions
Martin Krzywinski
#!/usr/local/bin/perl # new line at the end of each print, automatically $\ = "\n"; for (1..100) { $urd = rand(); if ( $urd < 0.25 ) { $sequence = $sequence . q(a); } elsif ( $urd < 0.5 ) { $sequence = $sequence . q(c); } elsif ( $urd < 0.75 ) { $sequence = $sequence . q(g); } else { $sequence = $sequence . q(t); } } print $sequence; print "saw poly-A" if $sequence =~ /aaaa/; print $sequence; print join(" + ", split("ata",$sequence));

2 | Text Manipulation and Regular Expressions | 1.0.1.8.2

1.0.1.8.2.p1 | Text Manipulation and Regular Expressions | Martin Krzywinski | ppt
1.0.1.8.2.c1 | case | Martin Krzywinski | code
1.0.1.8.2.c2 | chop | Martin Krzywinski | code
1.0.1.8.2.c3 | join | Martin Krzywinski | code
1.0.1.8.2.c4 | listop | Martin Krzywinski | code
1.0.1.8.2.c5 | recap | Martin Krzywinski | code
1.0.1.8.2.c6 | regex | Martin Krzywinski | code
1.0.1.8.2.c7 | sequence | Martin Krzywinski | code
1.0.1.8.2.c8 | split | Martin Krzywinski | code
1.0.1.8.2.c9 | substr | Martin Krzywinski | code
1.0.1.8.2.a1 | Text Manipulation and Regular Expressions | Martin Krzywinski | pdf
1.0.1.8.2.s1 | Text Manipulation and Regular Expressions | Martin Krzywinski | slides