--- /dev/null
+# Welcome to your first Perl script! Any line preceded with a '#' sign is a "comment". Perl ignores these lines; they are for human eyes only.
+
+# Except for this one... This line tells the computer to run this script (file) using Perl.
+#!usr/bin/perl
+
+# -- VARIABLES --
+
+# This is a variable "declaration"; it creates a variable and stores a value in it.
+# Variables can hold words, numbers, and other data. You can change their value. This variable holds some sample DNA sequence.
+my $test_sequence = "CCGATG";
+
+# -- READING INPUT --
+
+# Let's read in user input from the command line and assign it to a variable.
+my $user_sequence = $ARGV[0];
+
+# -- ANALYSIS AND PRINTING OUTPUT --
+
+# The "print" statement will create output.
+print "User sequence: " . $user_sequence . "\n";
+
+# Does the user sequence exactly match the test sequence?
+if ($user_sequence eq $test_sequence)
+{
+ print "We have a match!\n";
+ print $user_sequence . " is equivalent to " . $test_sequence . "\n";
+}
+else
+{
+ print "no match";
+}
--- /dev/null
+#!usr/bin/perl
+
+# Introduce loops and functions. Concept focus: Iteration, modularization. More string manipulation: parsing, identifying, counting sequence snippets.
+
+# this is a function. you can call it many times
+sub lookup($) {
+ my $motif = $ARGV[0];
+ print "Is $motif found in $_[0]? ";
+ if ($_[0] =~ /$motif/) {
+ print "Found it!\n";
+ print "How many times?";
+ # the hard way (a loop)
+ # the easy way (regular expression pattern-matching and countings)
+ }
+ else {
+ print "Nope...\n";
+ }
+}
+# end of function
+
+
+# main body of code
+my $seq = "ACGTGGCGCCGGCGCCATATATTTA";
+
+print "My sequence: " . $seq . "\n";
+
+lookup($seq);
--- /dev/null
+#!usr/bin/perl
+
+# Motif-finding using Lol's Vrs1/vrs1 barley samples. Will include file I/O and loops (for reading in sequence lines and for counting motifs).
+# Concept focus: A lot of biology data is stored in files and databases. We can read those files and databases to get data, analyze it with our code,
+# and generate new information as file, database, and/or image output. Read sequence data from files, locate feature(s), output information about those locations.
+
+# this is a function. you can call it many times
+sub lookup($) {
+ my $motif = "ACG";
+ print "Is $motif found in $_[0]? ";
+ if ($_[0] =~ /$motif/) {
+ print "Found it!\n";
+ }
+ else {
+ print "Nope...\n";
+ }
+}
+# end of function
+
+
+# main body of code
+my $seq = "ACGT";
+print "My sequence: " . $seq . "\n";
+lookup($seq);
+
+my $rev_seq = reverse($seq);
+print "Reversed: " . $rev_seq . "\n";
+lookup($rev_seq);
+
+$more_seq = $seq . "CCGAAT";
+print "Longer sequence: " . $more_seq . "\n";
+lookup($more_seq);