in reply to Splitting a string, Just want to Keep Half

defined is a verb, to detect whether a scalar has a value.

undef is a noun, to assign a scalar not have a value.

In the code below, some values are true, some false, but all are defined. Then, assigning undef to them means they are no longer defined. Notice that the hash still contains the key a, with no value associated with it; you would need to delete the key to remove the key from the hash.

our ( $s, $t, %h, @a ); $s = 0; $h{a} = ""; $a[1] = 1; print_vals(); print "\nundef-ing values\n"; $s = undef; $h{a} = undef; $a[1] = undef; print_vals(); sub print_vals { print "S " if ( defined $s ); print "T " if ( defined $t ); print "\n"; print "h{a} " if ( defined $h{a} ); print "h{b} " if ( defined $h{b} ); print "\n"; print "a[1] " if ( defined $a[1] ); print "a[0] " if ( defined $a[0] ); print "\n"; }

--
TTTATCGGTCGTTATATAGATGTTTGCA