#!/usr/bin/perl # Example 2 # Determine the percentage of GC in a DNA segment $DNA='CGTGGATATAGGCGGACC'; $GC = ($DNA =~ tr/GCgc//); $perGC = int(($GC/length($DNA))*100); print "\n"; print "The GC content is $perGC percent."; exit;