SlideShare una empresa de Scribd logo
1 de 82
Marc Logghe
Perl “A script is what you give an actor, but a program is what you give an audience.”
Goals Perl Positioning System: find your way in the Perl World Write Once, Use Many Times Object Oriented Perl Consumer Developer Thou shalt not be afraid of the Bioperl Beast
Agenda Day1 Perl refresher Scalars Arrays and lists Hashes Subroutines and functions Perldoc Creating and running a Perl script References and advanced data structures Packages and modules Objects, (multiple) inheritance, polymorphism
Agenda Day 2 What is bioperl ? Taming the Bioperl Beast Finding modules Finding methods Data::Dumper Sequence processing One image says more than 1000 words
Variables Data of any type may be stored within three basic types of variables: Scalar (strings, numbers, references) Array (aka list but not quite the same) Hash (aka associative array) Variable names are always preceded by a “dereferencing symbol” or prefix. If needed: {} $ - Scalar variables @ - List variables % - Associative array aka hash variables
Variables You do NOT have to  Declare the variable before using it Define the variable’s data type Allocate memory for new data values
Scalar variables Scalar variable stores a string, a number, a character, a reference, undef $name, ${name}, ${‘name’} More magic: $_
Array variables Array variable stores a list of scalars @name, @{name}, @{‘name’} Index Map: index => scalar value zero-indexed (distance from start)
Array variables List assignment: Individual assignment: $count[2] = 42 Individual acces: print $count[2] Special variable $#<array name> Scalar context @count = (1, 2, 3, 4, 5); @count = (‘apple’, ‘bat’, ‘cat’); @count2 = @count;
Array variables	 Access multiple values via array slice: Assign multiple values via array slice: print @array[3,2,4,1,0,-1]; @array[3,2,4,1,0,-1] = @new_values;
Lists List = temporary sequence of comma separated values usually in () or result of qw operator Array = container for a list Use: Array initialization Extract values from array my @array = qw/blood sweat tears/; my ($var1, $var2[42], $var3, @var4) = @args; my ($var5, $var6) = @args;
Lists List flattening Remember: each element of list must be a scalar, not another list => NOT hierarchical list of 3 elements ,[object Object],Individual access and slicing cf. arrays my @vehicles = (‘truck’, @cars, (‘tank’,’jeep’)); my @vehicles = (‘truck’, @cars, (‘tank’,’jeep’))[2,-1];
Hash variables Hash variables are denoted by the % dereferencing symbol. Hash variables is a list of key-value pairs Both keys and values must be scalar Notice the ‘=>’ aka ‘quotifying comma’ my %fruit_color = ("apple", "red", "banana", "yellow"); my %fruit_color = (         apple  => "red",         banana => "yellow",     );
Hash variables Individual access: $hash{key} Access multiple values via slice: Assign multiple values via slice: @slice = @hash{‘key2’,’key23’,’key4’}  @hash{‘key2’,’key23’,’key4’} = @new_values;
Non data types Filehandle There are several predefined filehandles, including STDIN, STDOUT, STDERR and DATA (default opened). No prefix Code value aka subroutine Dereferencing symbol “&”
Subroutines We can reuse a segment of Perl code by placing it within a subroutine. The subroutine is defined using the sub keyword and a name (= variable name !!). The subroutine body is defined by placing code statements within the {} code block symbols. sub MySubroutine{     #Perl code goes here.     my @args = @_; }
Subroutines To call a subroutine, prepend the name with the & symbol: &MySubroutine; # w/o arguments Or: MySubroutine(); # with or w/o arguments
Subroutines Arguments in underscore array variable (@_) List flattening !! my @results = MySubroutine(@arg1, ‘arg2’, (‘arg3’, ‘arg4’)); sub MySubroutine{     #Perl code goes here.     my ($thingy, @args) = @_; }
Subroutines Return value Nothing Scalar value List value Return value Explicit with return function Implicit: value of the last statement sub MySubroutine{     #Perl code goes here.     my ($thingy, @args) = @_; do_something(@args); }
Subroutines Calling contexts Void Scalar List wantarray function Void =>  undef Scalar => 0 List => 1 getFiles($dir); my $num = getFiles($dir); my @files = getFiles($dir);
Functions and operators   Built-in routines Function Arguments at right hand side Sensible name (defined, open, print, ...)
Functions Perl provides a rich set of built-in functions to help you perform common tasks. Several categories of useful built-in function include Arithmetic functions (sqrt, sin, … ) List functions (push, chomp, … ) String functions (length, substr, … ) Existance functions (defined, undef)
Array functions Array as queue: push/shift (FIFO) Array as stack: push/pop (LIFO) @row1 push shift 1 2 3 unshift pop
List functions chomp: remove newline from every element in the list map: kind of loop without escape, every element ($_) is ‘processed’ grep: kind of filter sort  join
Hash functions keys: returns the hash keys in random order values: returns values of the hash in random order but same order as keys function call each: returns (key, value) pairs delete: remove a particular key (and associated value) from a hash
Operators  Operator Complex and subtle (=,<>, <=>, ?:, ->,=>,...) Symbolic name (+,<,>,&,!, ...)
Operators Calling context Eg. assignment operator ‘=‘ ($item1, $item2) = @array; $item1 = @array;
perldoc Access to Perl’s documentation system Command line Web: http://perldoc.perl.org/ Documentation overview: perldoc perl Function info: perldoc perlfunc perldoc -f <function name> Operator info: perldoc perlop Searching the FAQs: perldoc -q <FAQ keyword>
perldoc Looking up module info Documentation: perldoc <module> Installation path: perldoc -l <module> Source: perldoc -m <module> All installed modules: perldoc -q installed
perldoc Move around
perldoc Searching
Creating a script Text editor (vi, textpad, notepad++, ...) IDE (Komodo, Eclipse, EMACS, Geany, ...) See: www.perlide.org  Shebang (not for modules) #!/usr/bin/perl
Executing a script Command line Windows .pl extension *NIX Shebang line chmod +x script ./script
Executing a script Geany IDE
References(and referents) A reference is a special scalar value which “refers to” or “points to” any value. A variable name is one kind of reference that you are already familiar with. It’s a given name. Reference is a kind of private, internal, computer generated name A referent is the value that the reference is pointing to
Creating References	 Method 1: references to variables are created by using the backslash( operator. $name = ‘bioperl’; 	$reference = name; 	$array_reference = array_name; 	$hash_reference = hash_name; 	$subroutine_ref = amp;sub_name;
Creating References	 Method 2: [ ITEMS ] makes a new, anonymous array and returns a reference to that array. { ITEMS } makes a new, anonymous hash, and returns a reference to that hash my $array_ref = [ 1, ‘foo’, undef, 13 ];  my $hash_ref = {one => 1, two => 2};
Dereferencing a Reference	 Use the appropriate dereferencing symbol Scalar: $ Array: @ Hash: % Subroutine: &
Dereferencing a Reference	 Remember $name, ${‘name’} ? Means: give me the scalar value where the variable ‘name’ is pointing to. A reference $reference ìs a name, so $$reference, ${$reference} Means: give me the scalar value where the reference $reference is pointing to
Dereferencing a Reference	 The arrow operator: -> Arrays and hashes Subroutines my $array_ref = [ 1, ‘foo’, undef, 13 ];  my $hash_ref = {one => 1, two => 2}; ${$array_ref}[1] = ${$hash_ref}{‘two’} # can be written as: $array_ref->[1] = $hash_ref->{two} &{$sub_ref}($arg1,$arg2) # can be written as: $sub_ref->($arg1, $arg2)
Identifying a referent ref function
References Why do we need references ??? Create complex data structures !! Arrays and hashes can only store scalar values  Pass arrays, hashes, subroutines, ... as arguments to subroutines and functions !! List flattening
Complex data structures	 Remind: Reference is a scalar value Arrays and hashes are sets of scalar values In one go:  my $array_ref = [ 1, 2, 3 ]; my $hash_ref = {one => 1, two => 2};  my %data = (	arrayref => $array_ref, hash_ref => $hash_ref); my %data = (	arrayref => [ 1, 2, 3 ], hash_ref => {one => 1, two => 2}  			);
Complex data structures	 Individual access my %data = (	arrayref => [ 1, 2, 3 ], hash_ref => {one => 1,                            two => [‘a’,’b’]}); How to access this value ? my $wanted_value = $data{hash_ref}->{two}->[1];
Complex data structures my @row1 = (1..3); my @row2 = (2,4,6); my @row3 = (3,6,9); my @rows = (row1,row2,row3); my $table = rows; @row1 $table 1 2 3 @rows @row2 2 4 6 @row3 3 6 9
Complex data structures my $table = [    [1, 2, 3],    [2, 4, 6],    [3, 6, 9] ]; $table 1 2 3 2 4 6 3 6 9
Complex data structures Individual access my $wanted_value = $table->[1]->[2]; # shorter form: $wanted_value = $table->[1][2]  $table 1 2 3 2 4 6 3 6 9
Packages and modules 2 types of variables: Global aka package variables Lexical variables
Packages and modules Global / package variables Visible everywhere in every program You get the if you don’t say otherwise !! Autovivification Name has 2 parts: family name + given name Default family name is ‘main’.    $John is actually $main::John $Cleese::John has nothing to do with $Wayne::John Family name = package name $var1 = 42; print “$var1, “, ++$var2; # results in: 42, 1
Packages and modules Lexical / private variables Explicitely declared as  Only visible within the boundaries of a code block or file. They cease to exist as soon as the program leaves the code block or the program ends The do not have a family name aka they do not belong to a package ALWAYS USE LEXICAL VARIABLES (except for subroutines ...) my $var1 = 42; #!/usr/bin/perl use strict; my $var1 = 42;
Packages Wikipedia: Family where the (global!) variables (incl. subroutines) live (remember $John) In general, a namespace is a container that provides context for the identifiers (variable names) it holds, and allows the disambiguation of homonym identifiers residing in different namespaces.
Packages Family has a: name, defined via package declaration House, block or blocks of code that follow the package declaration  package Bio::SeqIO::genbank; # welcome to the Bio::SeqIO::genbank family sub write_seq{} package Bio::SeqIO::fasta; # welcome to the Bio::SeqIO::fasta family sub write_seq{}
Packages Why do we need packages ??? To organize code To improve maintainability To avoid name space collisions
Modules What ? A text file(with a .pm suffix) containing Perl source code, that can contain any number of namespaces. It must evaluate to a true value. Loading At compile time: use <module> At run time: require <expr> <expr> and <module>:compiler translates each double-colon '::' into a path separator and appends '.pm'. E.g. Data::Dumper yields Data/Dumper.pm use Data::Dumper; require Data::Dumper; require ‘my_file.pl’; require $class;
Modules A module can contain multiple packages, but convention dictates that each module contains a package of the same name.  easy to quickly locate the code in any given package (perldoc –m <module>) not obligatory !! A module name is unique 1 to 1 mapping to file system !! Should start with capital letter
Module files Module files are stored in a subdirectory hierarchy that parallels the module name hierarchy. All module files must have an extension of .pm.
Modules Module path is relative. So, where is Perl searching for that module ? Possible modules roots @INC []$ perldoc –V … @INC:     /etc/perl     /usr/local/lib/perl/5.10.1     /usr/local/share/perl/5.10.1     /usr/lib/perl5     /usr/share/perl5     /usr/lib/perl/5.10     /usr/share/perl/5.10     /usr/local/lib/site_perl     .
Modules Alternative module roots (perldoc -q library) In script Command line  Environment use lib ‘/my/alternative/module/path’; []$ perl -I/my/alternative/module/path script.pl export PERL5LIB=$PERL5LIB:/my/alternative/module/path
Modules Test/Speak.pm Test.pl package My::Package::Says::Hello; sub speak {   print __PACKAGE__, " says: 'Hello'"; } package My::Package::Says::Blah; sub speak {   print __PACKAGE__, " says: 'Blah'"; } 1; #!/usr/bin/perl use strict; use Test::Speak; My::Package::Says::Hello>speak; My::Package::Says::Blah->speak;
Modules Why do we need modules??? To organize packages into files/folders Code reuse (ne copy & paste !) Module repository: CPAN http://search.cpan.org https://metacpan.org/ Pragma Special module that influences the code (compilation) Lowercase Lexically scoped
Modules Module information In standard distribution: perldoc perlmodlib Manually installed: perldoc perllocal All modules: perldoc –q installed Documentation: perldoc <module name> Location: perldoc –l <module name> Source: perldoc –m <module name>
Packages and Modules - Summary A package is a separate namespace within Perl code. A module can have more than one package defined within it. The default package is main. We can get to variables (and subroutines) within packages by using the fully qualified name To write a package, just write package <package name> where you want the package to start. Package declarations last until the end of the enclosing block, file or until the next package statement The require and use keywords can be used to import the contents of other files for use in a program. Files which are included must end with a true value. Perl looks for modules in a list of directories stored in @INC Module names map to the file system
Exercises Bioperl Training Exercise 1: perldoc Bioperl Training Exercise 2: thou shalt not forget Bioperl Training Exercise 3: arrays Bioperl Training Exercise 4: hashes Bioperl Training Exercise 5: packages and modules 1 Bioperl Training Exercise 6: packages and modules 2 Bioperl Training Exercise 7: complex data structures
Object Oriented Programming in Perl Why do we need objects and OOP ? It’s fun Code reuse Abstraction
Object Oriented Programming in Perl What is an object ? An object is a (complex) data structure representing a new, user defined type with a collection of behaviors (functions aka methods) Collection of attributes Developer’s perspective: 3 little make rules To create a class, build a package To create a method, write a subroutine To create an object, bless a referent
Rule 1: To create a class, build a package Defining a class A class is simply a package with subroutines that function as methods. Class name = type = label = namespace package Cat; 1;
Rule 2: To create a method, write a subroutine First argument of methods is always class name or object itself (or rather:  reference) Subroutine call the OO way (method invocation  arrow operator) package Cat; sub meow {   my $self = shift;   print __PACKAGE__ “ says: meow !”; } 1; Cat->meow; $cat->meow;
Rule 3: To create an object, bless a referent  ‘Special’ method: constructor Any name will do, in most cases new Object can be anything, in most cases hash Reference to object is stored in variable bless Arguments: reference (+ class). Does not change !! Underlying referent is blessed (= typed, labelled) Returns reference package Cat; sub new {   my ($class, @args) = @_;   my $self = { _name => $_args[0] };   bless $self, $class; }
Objects Perl objects are data structures ( a collection of attributes). To create an object we have to take 3 rules into account: Classes are just packages Methods are just subroutines Blessing a referent creates an object
Objects Objects are passed around as references Calling an object method can be done using the method invocation arrow: Constructor functions in Perl are conventionally called new() and can be called by writing:  $object_ref->method() $object_ref = ClassName->new()
Inheritance Concept Way to extend functionality of a class by deriving a (more specific) sub-class from it In Perl: Way of specifying where to look for methods store the name of 1 or more classes in the package variable @ISA Multiple inheritance  !! package NorthAmericanCat; use Cat; @ISA = qw(Cat); package NorthAmericanCat; use Cat; use Animal; @ISA = qw(Cat Animal);
Inheritance UNIVERSAL, parent of all classes Predifined methods isa(‘<class name>’): check if the object inherits from a particular class can(‘<method name>’): check if <method name> is a callable method
Inheritance SUPER: superclass of the current package start looking in @ISA for a class that can() do_something explicitely call a method of a parental class often used by Bioperl to initialize object attributes $self->SUPER::do_something()
Polymorphism Concept methods defined in the base class will override methods defined in the parent classes same method has different behaviours

Más contenido relacionado

La actualidad más candente (18)

PHP array 1
PHP array 1PHP array 1
PHP array 1
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
Chap 3php array part1
Chap 3php array part1Chap 3php array part1
Chap 3php array part1
 
4.1 PHP Arrays
4.1 PHP Arrays4.1 PHP Arrays
4.1 PHP Arrays
 
DBIx::Class introduction - 2010
DBIx::Class introduction - 2010DBIx::Class introduction - 2010
DBIx::Class introduction - 2010
 
Data structure in perl
Data structure in perlData structure in perl
Data structure in perl
 
Scripting3
Scripting3Scripting3
Scripting3
 
Introduction to perl_lists
Introduction to perl_listsIntroduction to perl_lists
Introduction to perl_lists
 
Array in php
Array in phpArray in php
Array in php
 
03 Php Array String Functions
03 Php Array String Functions03 Php Array String Functions
03 Php Array String Functions
 
Array,lists and hashes in perl
Array,lists and hashes in perlArray,lists and hashes in perl
Array,lists and hashes in perl
 
Hashes
HashesHashes
Hashes
 
Working with text, Regular expressions
Working with text, Regular expressionsWorking with text, Regular expressions
Working with text, Regular expressions
 
Intermediate Perl
Intermediate PerlIntermediate Perl
Intermediate Perl
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2
 
Array
ArrayArray
Array
 
Lists
ListsLists
Lists
 

Destacado

تحليل محتوى عاشر تك الانظمة
تحليل محتوى عاشر تك الانظمةتحليل محتوى عاشر تك الانظمة
تحليل محتوى عاشر تك الانظمةRola Attia
 
Programming for biologists
Programming for biologistsProgramming for biologists
Programming for biologistsjigma
 
BioPerl: Developming Open Source Software
BioPerl: Developming Open Source SoftwareBioPerl: Developming Open Source Software
BioPerl: Developming Open Source SoftwareJason Stajich
 
PERL- Bioperl modules
PERL- Bioperl modulesPERL- Bioperl modules
PERL- Bioperl modulesNixon Mendez
 
Bioinformatics and BioPerl
Bioinformatics and BioPerlBioinformatics and BioPerl
Bioinformatics and BioPerlJason Stajich
 
Fields bosc2010 bio_perl
Fields bosc2010 bio_perlFields bosc2010 bio_perl
Fields bosc2010 bio_perlBOSC 2010
 
Sant jordi
Sant jordiSant jordi
Sant jordieuragan
 
Presentación1
Presentación1Presentación1
Presentación1escuela5
 
Smau milano 2013 fratepietro vaciago
Smau milano 2013 fratepietro vaciagoSmau milano 2013 fratepietro vaciago
Smau milano 2013 fratepietro vaciagoSMAU
 
EXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIM
EXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIMEXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIM
EXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIMroy mendez
 
eChaty magazín Jaro 2013
eChaty magazín Jaro 2013eChaty magazín Jaro 2013
eChaty magazín Jaro 2013eChaty.cz
 
Trabajo Práctico de Periodismo - noticia
Trabajo Práctico de Periodismo - noticiaTrabajo Práctico de Periodismo - noticia
Trabajo Práctico de Periodismo - noticiacamitooooo
 
Ultimos avances tecnológicos
Ultimos avances tecnológicosUltimos avances tecnológicos
Ultimos avances tecnológicosbrianxhp
 
Social Media for CEOs - The External Opportunity
Social Media for CEOs - The External OpportunitySocial Media for CEOs - The External Opportunity
Social Media for CEOs - The External OpportunityOur Social Times
 
Guardia Civil
Guardia CivilGuardia Civil
Guardia CivilDraco703
 
[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324
[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324
[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324kiaworkcamp
 
Brainsprouting- Don Inservice 2016
Brainsprouting- Don Inservice 2016Brainsprouting- Don Inservice 2016
Brainsprouting- Don Inservice 2016Erica Fearnall
 
Weathering Market Storms
Weathering Market StormsWeathering Market Storms
Weathering Market Stormsdkeogh
 
Natalija Popović - Budućnost kao imperativ, Controlling magazin 06
Natalija Popović - Budućnost kao imperativ, Controlling magazin 06Natalija Popović - Budućnost kao imperativ, Controlling magazin 06
Natalija Popović - Budućnost kao imperativ, Controlling magazin 06Menadžment Centar Beograd
 

Destacado (20)

تحليل محتوى عاشر تك الانظمة
تحليل محتوى عاشر تك الانظمةتحليل محتوى عاشر تك الانظمة
تحليل محتوى عاشر تك الانظمة
 
Programming for biologists
Programming for biologistsProgramming for biologists
Programming for biologists
 
BioPerl: Developming Open Source Software
BioPerl: Developming Open Source SoftwareBioPerl: Developming Open Source Software
BioPerl: Developming Open Source Software
 
PERL- Bioperl modules
PERL- Bioperl modulesPERL- Bioperl modules
PERL- Bioperl modules
 
Bioinformatics and BioPerl
Bioinformatics and BioPerlBioinformatics and BioPerl
Bioinformatics and BioPerl
 
Fields bosc2010 bio_perl
Fields bosc2010 bio_perlFields bosc2010 bio_perl
Fields bosc2010 bio_perl
 
Sant jordi
Sant jordiSant jordi
Sant jordi
 
Presentación1
Presentación1Presentación1
Presentación1
 
Smau milano 2013 fratepietro vaciago
Smau milano 2013 fratepietro vaciagoSmau milano 2013 fratepietro vaciago
Smau milano 2013 fratepietro vaciago
 
EXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIM
EXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIMEXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIM
EXAMEN PRÁCTICO DE COMPUTACIÓN 2DO BIM
 
eChaty magazín Jaro 2013
eChaty magazín Jaro 2013eChaty magazín Jaro 2013
eChaty magazín Jaro 2013
 
Trabajo Práctico de Periodismo - noticia
Trabajo Práctico de Periodismo - noticiaTrabajo Práctico de Periodismo - noticia
Trabajo Práctico de Periodismo - noticia
 
Ultimos avances tecnológicos
Ultimos avances tecnológicosUltimos avances tecnológicos
Ultimos avances tecnológicos
 
Social Media for CEOs - The External Opportunity
Social Media for CEOs - The External OpportunitySocial Media for CEOs - The External Opportunity
Social Media for CEOs - The External Opportunity
 
Guardia Civil
Guardia CivilGuardia Civil
Guardia Civil
 
[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324
[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324
[기아워캠9기] 정연지 활동결과보고_독일 IJGD4324
 
Brainsprouting- Don Inservice 2016
Brainsprouting- Don Inservice 2016Brainsprouting- Don Inservice 2016
Brainsprouting- Don Inservice 2016
 
Weathering Market Storms
Weathering Market StormsWeathering Market Storms
Weathering Market Storms
 
Yo Misma
Yo MismaYo Misma
Yo Misma
 
Natalija Popović - Budućnost kao imperativ, Controlling magazin 06
Natalija Popović - Budućnost kao imperativ, Controlling magazin 06Natalija Popović - Budućnost kao imperativ, Controlling magazin 06
Natalija Popović - Budućnost kao imperativ, Controlling magazin 06
 

Similar a Perl Positioning System

Chap1introppt2php(finally done)
Chap1introppt2php(finally done)Chap1introppt2php(finally done)
Chap1introppt2php(finally done)monikadeshmane
 
Introduction to Perl - Day 2
Introduction to Perl - Day 2Introduction to Perl - Day 2
Introduction to Perl - Day 2Dave Cross
 
Underscore.js
Underscore.jsUnderscore.js
Underscore.jstimourian
 
Php Chapter 2 3 Training
Php Chapter 2 3 TrainingPhp Chapter 2 3 Training
Php Chapter 2 3 TrainingChris Chubb
 
WordCamp Portland 2018: PHP for WordPress
WordCamp Portland 2018: PHP for WordPressWordCamp Portland 2018: PHP for WordPress
WordCamp Portland 2018: PHP for WordPressAlena Holligan
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Dhivyaa C.R
 
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvZahouAmel1
 
9780538745840 ppt ch06
9780538745840 ppt ch069780538745840 ppt ch06
9780538745840 ppt ch06Terry Yoast
 
PHP Conference Asia 2016
PHP Conference Asia 2016PHP Conference Asia 2016
PHP Conference Asia 2016Britta Alex
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perlworr1244
 
Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128PrinceGuru MS
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & ArraysHenry Osborne
 

Similar a Perl Positioning System (20)

Chap1introppt2php(finally done)
Chap1introppt2php(finally done)Chap1introppt2php(finally done)
Chap1introppt2php(finally done)
 
Chapter 2 wbp.pptx
Chapter 2 wbp.pptxChapter 2 wbp.pptx
Chapter 2 wbp.pptx
 
php AND MYSQL _ppt.pdf
php AND MYSQL _ppt.pdfphp AND MYSQL _ppt.pdf
php AND MYSQL _ppt.pdf
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
Introduction to Perl - Day 2
Introduction to Perl - Day 2Introduction to Perl - Day 2
Introduction to Perl - Day 2
 
Php & my sql
Php & my sqlPhp & my sql
Php & my sql
 
Underscore.js
Underscore.jsUnderscore.js
Underscore.js
 
Php Chapter 2 3 Training
Php Chapter 2 3 TrainingPhp Chapter 2 3 Training
Php Chapter 2 3 Training
 
WordCamp Portland 2018: PHP for WordPress
WordCamp Portland 2018: PHP for WordPressWordCamp Portland 2018: PHP for WordPress
WordCamp Portland 2018: PHP for WordPress
 
Arrays in php
Arrays in phpArrays in php
Arrays in php
 
UNIT IV (4).pptx
UNIT IV (4).pptxUNIT IV (4).pptx
UNIT IV (4).pptx
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
 
Introduction to Perl and BioPerl
Introduction to Perl and BioPerlIntroduction to Perl and BioPerl
Introduction to Perl and BioPerl
 
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
9780538745840 ppt ch06
9780538745840 ppt ch069780538745840 ppt ch06
9780538745840 ppt ch06
 
PHP Conference Asia 2016
PHP Conference Asia 2016PHP Conference Asia 2016
PHP Conference Asia 2016
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128
 
Training on php by cyber security infotech (csi)
Training on  php by cyber security infotech (csi)Training on  php by cyber security infotech (csi)
Training on php by cyber security infotech (csi)
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & Arrays
 

Más de BITS

RNA-seq for DE analysis: detecting differential expression - part 5
RNA-seq for DE analysis: detecting differential expression - part 5RNA-seq for DE analysis: detecting differential expression - part 5
RNA-seq for DE analysis: detecting differential expression - part 5BITS
 
RNA-seq for DE analysis: extracting counts and QC - part 4
RNA-seq for DE analysis: extracting counts and QC - part 4RNA-seq for DE analysis: extracting counts and QC - part 4
RNA-seq for DE analysis: extracting counts and QC - part 4BITS
 
RNA-seq for DE analysis: the biology behind observed changes - part 6
RNA-seq for DE analysis: the biology behind observed changes - part 6RNA-seq for DE analysis: the biology behind observed changes - part 6
RNA-seq for DE analysis: the biology behind observed changes - part 6BITS
 
RNA-seq: analysis of raw data and preprocessing - part 2
RNA-seq: analysis of raw data and preprocessing - part 2RNA-seq: analysis of raw data and preprocessing - part 2
RNA-seq: analysis of raw data and preprocessing - part 2BITS
 
RNA-seq: general concept, goal and experimental design - part 1
RNA-seq: general concept, goal and experimental design - part 1RNA-seq: general concept, goal and experimental design - part 1
RNA-seq: general concept, goal and experimental design - part 1BITS
 
RNA-seq: Mapping and quality control - part 3
RNA-seq: Mapping and quality control - part 3RNA-seq: Mapping and quality control - part 3
RNA-seq: Mapping and quality control - part 3BITS
 
Productivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsProductivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsBITS
 
Text mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformaticsText mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformaticsBITS
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsBITS
 
Managing your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsManaging your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsBITS
 
Introduction to Linux for bioinformatics
Introduction to Linux for bioinformaticsIntroduction to Linux for bioinformatics
Introduction to Linux for bioinformaticsBITS
 
BITS - Genevestigator to easily access transcriptomics data
BITS - Genevestigator to easily access transcriptomics dataBITS - Genevestigator to easily access transcriptomics data
BITS - Genevestigator to easily access transcriptomics dataBITS
 
BITS - Comparative genomics: the Contra tool
BITS - Comparative genomics: the Contra toolBITS - Comparative genomics: the Contra tool
BITS - Comparative genomics: the Contra toolBITS
 
BITS - Comparative genomics on the genome level
BITS - Comparative genomics on the genome levelBITS - Comparative genomics on the genome level
BITS - Comparative genomics on the genome levelBITS
 
BITS - Comparative genomics: gene family analysis
BITS - Comparative genomics: gene family analysisBITS - Comparative genomics: gene family analysis
BITS - Comparative genomics: gene family analysisBITS
 
BITS - Introduction to comparative genomics
BITS - Introduction to comparative genomicsBITS - Introduction to comparative genomics
BITS - Introduction to comparative genomicsBITS
 
BITS - Protein inference from mass spectrometry data
BITS - Protein inference from mass spectrometry dataBITS - Protein inference from mass spectrometry data
BITS - Protein inference from mass spectrometry dataBITS
 
BITS - Overview of sequence databases for mass spectrometry data analysis
BITS - Overview of sequence databases for mass spectrometry data analysisBITS - Overview of sequence databases for mass spectrometry data analysis
BITS - Overview of sequence databases for mass spectrometry data analysisBITS
 
BITS - Search engines for mass spec data
BITS - Search engines for mass spec dataBITS - Search engines for mass spec data
BITS - Search engines for mass spec dataBITS
 
BITS - Introduction to proteomics
BITS - Introduction to proteomicsBITS - Introduction to proteomics
BITS - Introduction to proteomicsBITS
 

Más de BITS (20)

RNA-seq for DE analysis: detecting differential expression - part 5
RNA-seq for DE analysis: detecting differential expression - part 5RNA-seq for DE analysis: detecting differential expression - part 5
RNA-seq for DE analysis: detecting differential expression - part 5
 
RNA-seq for DE analysis: extracting counts and QC - part 4
RNA-seq for DE analysis: extracting counts and QC - part 4RNA-seq for DE analysis: extracting counts and QC - part 4
RNA-seq for DE analysis: extracting counts and QC - part 4
 
RNA-seq for DE analysis: the biology behind observed changes - part 6
RNA-seq for DE analysis: the biology behind observed changes - part 6RNA-seq for DE analysis: the biology behind observed changes - part 6
RNA-seq for DE analysis: the biology behind observed changes - part 6
 
RNA-seq: analysis of raw data and preprocessing - part 2
RNA-seq: analysis of raw data and preprocessing - part 2RNA-seq: analysis of raw data and preprocessing - part 2
RNA-seq: analysis of raw data and preprocessing - part 2
 
RNA-seq: general concept, goal and experimental design - part 1
RNA-seq: general concept, goal and experimental design - part 1RNA-seq: general concept, goal and experimental design - part 1
RNA-seq: general concept, goal and experimental design - part 1
 
RNA-seq: Mapping and quality control - part 3
RNA-seq: Mapping and quality control - part 3RNA-seq: Mapping and quality control - part 3
RNA-seq: Mapping and quality control - part 3
 
Productivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsProductivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformatics
 
Text mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformaticsText mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformatics
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
 
Managing your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsManaging your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformatics
 
Introduction to Linux for bioinformatics
Introduction to Linux for bioinformaticsIntroduction to Linux for bioinformatics
Introduction to Linux for bioinformatics
 
BITS - Genevestigator to easily access transcriptomics data
BITS - Genevestigator to easily access transcriptomics dataBITS - Genevestigator to easily access transcriptomics data
BITS - Genevestigator to easily access transcriptomics data
 
BITS - Comparative genomics: the Contra tool
BITS - Comparative genomics: the Contra toolBITS - Comparative genomics: the Contra tool
BITS - Comparative genomics: the Contra tool
 
BITS - Comparative genomics on the genome level
BITS - Comparative genomics on the genome levelBITS - Comparative genomics on the genome level
BITS - Comparative genomics on the genome level
 
BITS - Comparative genomics: gene family analysis
BITS - Comparative genomics: gene family analysisBITS - Comparative genomics: gene family analysis
BITS - Comparative genomics: gene family analysis
 
BITS - Introduction to comparative genomics
BITS - Introduction to comparative genomicsBITS - Introduction to comparative genomics
BITS - Introduction to comparative genomics
 
BITS - Protein inference from mass spectrometry data
BITS - Protein inference from mass spectrometry dataBITS - Protein inference from mass spectrometry data
BITS - Protein inference from mass spectrometry data
 
BITS - Overview of sequence databases for mass spectrometry data analysis
BITS - Overview of sequence databases for mass spectrometry data analysisBITS - Overview of sequence databases for mass spectrometry data analysis
BITS - Overview of sequence databases for mass spectrometry data analysis
 
BITS - Search engines for mass spec data
BITS - Search engines for mass spec dataBITS - Search engines for mass spec data
BITS - Search engines for mass spec data
 
BITS - Introduction to proteomics
BITS - Introduction to proteomicsBITS - Introduction to proteomics
BITS - Introduction to proteomics
 

Último

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

Perl Positioning System

  • 2. Perl “A script is what you give an actor, but a program is what you give an audience.”
  • 3. Goals Perl Positioning System: find your way in the Perl World Write Once, Use Many Times Object Oriented Perl Consumer Developer Thou shalt not be afraid of the Bioperl Beast
  • 4.
  • 5. Agenda Day1 Perl refresher Scalars Arrays and lists Hashes Subroutines and functions Perldoc Creating and running a Perl script References and advanced data structures Packages and modules Objects, (multiple) inheritance, polymorphism
  • 6. Agenda Day 2 What is bioperl ? Taming the Bioperl Beast Finding modules Finding methods Data::Dumper Sequence processing One image says more than 1000 words
  • 7. Variables Data of any type may be stored within three basic types of variables: Scalar (strings, numbers, references) Array (aka list but not quite the same) Hash (aka associative array) Variable names are always preceded by a “dereferencing symbol” or prefix. If needed: {} $ - Scalar variables @ - List variables % - Associative array aka hash variables
  • 8. Variables You do NOT have to Declare the variable before using it Define the variable’s data type Allocate memory for new data values
  • 9. Scalar variables Scalar variable stores a string, a number, a character, a reference, undef $name, ${name}, ${‘name’} More magic: $_
  • 10. Array variables Array variable stores a list of scalars @name, @{name}, @{‘name’} Index Map: index => scalar value zero-indexed (distance from start)
  • 11. Array variables List assignment: Individual assignment: $count[2] = 42 Individual acces: print $count[2] Special variable $#<array name> Scalar context @count = (1, 2, 3, 4, 5); @count = (‘apple’, ‘bat’, ‘cat’); @count2 = @count;
  • 12. Array variables Access multiple values via array slice: Assign multiple values via array slice: print @array[3,2,4,1,0,-1]; @array[3,2,4,1,0,-1] = @new_values;
  • 13. Lists List = temporary sequence of comma separated values usually in () or result of qw operator Array = container for a list Use: Array initialization Extract values from array my @array = qw/blood sweat tears/; my ($var1, $var2[42], $var3, @var4) = @args; my ($var5, $var6) = @args;
  • 14.
  • 15. Hash variables Hash variables are denoted by the % dereferencing symbol. Hash variables is a list of key-value pairs Both keys and values must be scalar Notice the ‘=>’ aka ‘quotifying comma’ my %fruit_color = ("apple", "red", "banana", "yellow"); my %fruit_color = ( apple => "red", banana => "yellow", );
  • 16. Hash variables Individual access: $hash{key} Access multiple values via slice: Assign multiple values via slice: @slice = @hash{‘key2’,’key23’,’key4’} @hash{‘key2’,’key23’,’key4’} = @new_values;
  • 17. Non data types Filehandle There are several predefined filehandles, including STDIN, STDOUT, STDERR and DATA (default opened). No prefix Code value aka subroutine Dereferencing symbol “&”
  • 18.
  • 19. Subroutines We can reuse a segment of Perl code by placing it within a subroutine. The subroutine is defined using the sub keyword and a name (= variable name !!). The subroutine body is defined by placing code statements within the {} code block symbols. sub MySubroutine{ #Perl code goes here. my @args = @_; }
  • 20. Subroutines To call a subroutine, prepend the name with the & symbol: &MySubroutine; # w/o arguments Or: MySubroutine(); # with or w/o arguments
  • 21. Subroutines Arguments in underscore array variable (@_) List flattening !! my @results = MySubroutine(@arg1, ‘arg2’, (‘arg3’, ‘arg4’)); sub MySubroutine{ #Perl code goes here. my ($thingy, @args) = @_; }
  • 22. Subroutines Return value Nothing Scalar value List value Return value Explicit with return function Implicit: value of the last statement sub MySubroutine{ #Perl code goes here. my ($thingy, @args) = @_; do_something(@args); }
  • 23. Subroutines Calling contexts Void Scalar List wantarray function Void => undef Scalar => 0 List => 1 getFiles($dir); my $num = getFiles($dir); my @files = getFiles($dir);
  • 24. Functions and operators Built-in routines Function Arguments at right hand side Sensible name (defined, open, print, ...)
  • 25. Functions Perl provides a rich set of built-in functions to help you perform common tasks. Several categories of useful built-in function include Arithmetic functions (sqrt, sin, … ) List functions (push, chomp, … ) String functions (length, substr, … ) Existance functions (defined, undef)
  • 26. Array functions Array as queue: push/shift (FIFO) Array as stack: push/pop (LIFO) @row1 push shift 1 2 3 unshift pop
  • 27. List functions chomp: remove newline from every element in the list map: kind of loop without escape, every element ($_) is ‘processed’ grep: kind of filter sort join
  • 28. Hash functions keys: returns the hash keys in random order values: returns values of the hash in random order but same order as keys function call each: returns (key, value) pairs delete: remove a particular key (and associated value) from a hash
  • 29. Operators Operator Complex and subtle (=,<>, <=>, ?:, ->,=>,...) Symbolic name (+,<,>,&,!, ...)
  • 30. Operators Calling context Eg. assignment operator ‘=‘ ($item1, $item2) = @array; $item1 = @array;
  • 31.
  • 32. perldoc Access to Perl’s documentation system Command line Web: http://perldoc.perl.org/ Documentation overview: perldoc perl Function info: perldoc perlfunc perldoc -f <function name> Operator info: perldoc perlop Searching the FAQs: perldoc -q <FAQ keyword>
  • 33. perldoc Looking up module info Documentation: perldoc <module> Installation path: perldoc -l <module> Source: perldoc -m <module> All installed modules: perldoc -q installed
  • 36. Creating a script Text editor (vi, textpad, notepad++, ...) IDE (Komodo, Eclipse, EMACS, Geany, ...) See: www.perlide.org Shebang (not for modules) #!/usr/bin/perl
  • 37. Executing a script Command line Windows .pl extension *NIX Shebang line chmod +x script ./script
  • 38. Executing a script Geany IDE
  • 39.
  • 40. References(and referents) A reference is a special scalar value which “refers to” or “points to” any value. A variable name is one kind of reference that you are already familiar with. It’s a given name. Reference is a kind of private, internal, computer generated name A referent is the value that the reference is pointing to
  • 41. Creating References Method 1: references to variables are created by using the backslash( operator. $name = ‘bioperl’; $reference = name; $array_reference = array_name; $hash_reference = hash_name; $subroutine_ref = amp;sub_name;
  • 42. Creating References Method 2: [ ITEMS ] makes a new, anonymous array and returns a reference to that array. { ITEMS } makes a new, anonymous hash, and returns a reference to that hash my $array_ref = [ 1, ‘foo’, undef, 13 ]; my $hash_ref = {one => 1, two => 2};
  • 43. Dereferencing a Reference Use the appropriate dereferencing symbol Scalar: $ Array: @ Hash: % Subroutine: &
  • 44. Dereferencing a Reference Remember $name, ${‘name’} ? Means: give me the scalar value where the variable ‘name’ is pointing to. A reference $reference ìs a name, so $$reference, ${$reference} Means: give me the scalar value where the reference $reference is pointing to
  • 45. Dereferencing a Reference The arrow operator: -> Arrays and hashes Subroutines my $array_ref = [ 1, ‘foo’, undef, 13 ]; my $hash_ref = {one => 1, two => 2}; ${$array_ref}[1] = ${$hash_ref}{‘two’} # can be written as: $array_ref->[1] = $hash_ref->{two} &{$sub_ref}($arg1,$arg2) # can be written as: $sub_ref->($arg1, $arg2)
  • 46. Identifying a referent ref function
  • 47. References Why do we need references ??? Create complex data structures !! Arrays and hashes can only store scalar values Pass arrays, hashes, subroutines, ... as arguments to subroutines and functions !! List flattening
  • 48. Complex data structures Remind: Reference is a scalar value Arrays and hashes are sets of scalar values In one go: my $array_ref = [ 1, 2, 3 ]; my $hash_ref = {one => 1, two => 2}; my %data = ( arrayref => $array_ref, hash_ref => $hash_ref); my %data = ( arrayref => [ 1, 2, 3 ], hash_ref => {one => 1, two => 2} );
  • 49. Complex data structures Individual access my %data = ( arrayref => [ 1, 2, 3 ], hash_ref => {one => 1, two => [‘a’,’b’]}); How to access this value ? my $wanted_value = $data{hash_ref}->{two}->[1];
  • 50. Complex data structures my @row1 = (1..3); my @row2 = (2,4,6); my @row3 = (3,6,9); my @rows = (row1,row2,row3); my $table = rows; @row1 $table 1 2 3 @rows @row2 2 4 6 @row3 3 6 9
  • 51. Complex data structures my $table = [ [1, 2, 3], [2, 4, 6], [3, 6, 9] ]; $table 1 2 3 2 4 6 3 6 9
  • 52. Complex data structures Individual access my $wanted_value = $table->[1]->[2]; # shorter form: $wanted_value = $table->[1][2] $table 1 2 3 2 4 6 3 6 9
  • 53. Packages and modules 2 types of variables: Global aka package variables Lexical variables
  • 54. Packages and modules Global / package variables Visible everywhere in every program You get the if you don’t say otherwise !! Autovivification Name has 2 parts: family name + given name Default family name is ‘main’. $John is actually $main::John $Cleese::John has nothing to do with $Wayne::John Family name = package name $var1 = 42; print “$var1, “, ++$var2; # results in: 42, 1
  • 55.
  • 56. Packages and modules Lexical / private variables Explicitely declared as Only visible within the boundaries of a code block or file. They cease to exist as soon as the program leaves the code block or the program ends The do not have a family name aka they do not belong to a package ALWAYS USE LEXICAL VARIABLES (except for subroutines ...) my $var1 = 42; #!/usr/bin/perl use strict; my $var1 = 42;
  • 57. Packages Wikipedia: Family where the (global!) variables (incl. subroutines) live (remember $John) In general, a namespace is a container that provides context for the identifiers (variable names) it holds, and allows the disambiguation of homonym identifiers residing in different namespaces.
  • 58. Packages Family has a: name, defined via package declaration House, block or blocks of code that follow the package declaration package Bio::SeqIO::genbank; # welcome to the Bio::SeqIO::genbank family sub write_seq{} package Bio::SeqIO::fasta; # welcome to the Bio::SeqIO::fasta family sub write_seq{}
  • 59. Packages Why do we need packages ??? To organize code To improve maintainability To avoid name space collisions
  • 60. Modules What ? A text file(with a .pm suffix) containing Perl source code, that can contain any number of namespaces. It must evaluate to a true value. Loading At compile time: use <module> At run time: require <expr> <expr> and <module>:compiler translates each double-colon '::' into a path separator and appends '.pm'. E.g. Data::Dumper yields Data/Dumper.pm use Data::Dumper; require Data::Dumper; require ‘my_file.pl’; require $class;
  • 61. Modules A module can contain multiple packages, but convention dictates that each module contains a package of the same name. easy to quickly locate the code in any given package (perldoc –m <module>) not obligatory !! A module name is unique 1 to 1 mapping to file system !! Should start with capital letter
  • 62. Module files Module files are stored in a subdirectory hierarchy that parallels the module name hierarchy. All module files must have an extension of .pm.
  • 63. Modules Module path is relative. So, where is Perl searching for that module ? Possible modules roots @INC []$ perldoc –V … @INC: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .
  • 64. Modules Alternative module roots (perldoc -q library) In script Command line Environment use lib ‘/my/alternative/module/path’; []$ perl -I/my/alternative/module/path script.pl export PERL5LIB=$PERL5LIB:/my/alternative/module/path
  • 65. Modules Test/Speak.pm Test.pl package My::Package::Says::Hello; sub speak { print __PACKAGE__, " says: 'Hello'"; } package My::Package::Says::Blah; sub speak { print __PACKAGE__, " says: 'Blah'"; } 1; #!/usr/bin/perl use strict; use Test::Speak; My::Package::Says::Hello>speak; My::Package::Says::Blah->speak;
  • 66. Modules Why do we need modules??? To organize packages into files/folders Code reuse (ne copy & paste !) Module repository: CPAN http://search.cpan.org https://metacpan.org/ Pragma Special module that influences the code (compilation) Lowercase Lexically scoped
  • 67. Modules Module information In standard distribution: perldoc perlmodlib Manually installed: perldoc perllocal All modules: perldoc –q installed Documentation: perldoc <module name> Location: perldoc –l <module name> Source: perldoc –m <module name>
  • 68. Packages and Modules - Summary A package is a separate namespace within Perl code. A module can have more than one package defined within it. The default package is main. We can get to variables (and subroutines) within packages by using the fully qualified name To write a package, just write package <package name> where you want the package to start. Package declarations last until the end of the enclosing block, file or until the next package statement The require and use keywords can be used to import the contents of other files for use in a program. Files which are included must end with a true value. Perl looks for modules in a list of directories stored in @INC Module names map to the file system
  • 69.
  • 70. Exercises Bioperl Training Exercise 1: perldoc Bioperl Training Exercise 2: thou shalt not forget Bioperl Training Exercise 3: arrays Bioperl Training Exercise 4: hashes Bioperl Training Exercise 5: packages and modules 1 Bioperl Training Exercise 6: packages and modules 2 Bioperl Training Exercise 7: complex data structures
  • 71.
  • 72. Object Oriented Programming in Perl Why do we need objects and OOP ? It’s fun Code reuse Abstraction
  • 73. Object Oriented Programming in Perl What is an object ? An object is a (complex) data structure representing a new, user defined type with a collection of behaviors (functions aka methods) Collection of attributes Developer’s perspective: 3 little make rules To create a class, build a package To create a method, write a subroutine To create an object, bless a referent
  • 74. Rule 1: To create a class, build a package Defining a class A class is simply a package with subroutines that function as methods. Class name = type = label = namespace package Cat; 1;
  • 75. Rule 2: To create a method, write a subroutine First argument of methods is always class name or object itself (or rather: reference) Subroutine call the OO way (method invocation arrow operator) package Cat; sub meow { my $self = shift; print __PACKAGE__ “ says: meow !”; } 1; Cat->meow; $cat->meow;
  • 76. Rule 3: To create an object, bless a referent ‘Special’ method: constructor Any name will do, in most cases new Object can be anything, in most cases hash Reference to object is stored in variable bless Arguments: reference (+ class). Does not change !! Underlying referent is blessed (= typed, labelled) Returns reference package Cat; sub new { my ($class, @args) = @_; my $self = { _name => $_args[0] }; bless $self, $class; }
  • 77. Objects Perl objects are data structures ( a collection of attributes). To create an object we have to take 3 rules into account: Classes are just packages Methods are just subroutines Blessing a referent creates an object
  • 78. Objects Objects are passed around as references Calling an object method can be done using the method invocation arrow: Constructor functions in Perl are conventionally called new() and can be called by writing: $object_ref->method() $object_ref = ClassName->new()
  • 79. Inheritance Concept Way to extend functionality of a class by deriving a (more specific) sub-class from it In Perl: Way of specifying where to look for methods store the name of 1 or more classes in the package variable @ISA Multiple inheritance !! package NorthAmericanCat; use Cat; @ISA = qw(Cat); package NorthAmericanCat; use Cat; use Animal; @ISA = qw(Cat Animal);
  • 80. Inheritance UNIVERSAL, parent of all classes Predifined methods isa(‘<class name>’): check if the object inherits from a particular class can(‘<method name>’): check if <method name> is a callable method
  • 81. Inheritance SUPER: superclass of the current package start looking in @ISA for a class that can() do_something explicitely call a method of a parental class often used by Bioperl to initialize object attributes $self->SUPER::do_something()
  • 82. Polymorphism Concept methods defined in the base class will override methods defined in the parent classes same method has different behaviours
  • 83.
  • 84. Exercises Bioperl Training Exercise 8: OOP Bioperl Training Exercise 9: inheritance, polymorphism Bioperl Training Exercise 10: aggregation, delegation

Notas del editor

  1. Remember to wear it !
  2. Not often needed. Why might you need the braces ? String interpolation:$name = ‘Johnny’;Print “$name1”; # =&gt; nothing printedPrint “${name}1”; # =&gt; ‘Johnny1’
  3. If there are more variables in the list than elements in the array, the extra variables are assigned the udefined value. If there are fewer variables than array elements, the extra elements are ignored.Distributiviteit: my ()
  4. If there are more variables in the list than elements in the array, the extra variables are assigned the udefined value. If there are fewer variables than array elements, the extra elements are ignored.
  5. Comma is operator: flattens (‘concatenates’) lists/arrays
  6. Comma is operator: flattens (‘concatenates’) lists/arrays
  7. No parens needed: comma operators produce list
  8. main should have been called ‘our’ ;-)Not needed to use the family name when you are with your family. If you call John for dinner, John will know it’s him and you know who will come.But if your family has visitors of another family and they have a John in the family as well ...Family name + given name = fully qualified variable name