Line = 'org_name,"My Organization"' Field = 'org_name ' Field Length = 9 Trim Length = 'org_name ' Line ($line) is a string to which I want to compare some key words. Field ($field) is one of the key words. I have placed single quotes around the value so I can see its length. Field Length ($length) is the result of the Perl length($field) function. Trim Length ($trim_length) is the result of substr ($field, 0, $length). $field is read from a database table using the @fields = qx{query}; The relationship between @fields and $field comes from a foreach @field (@fields) loop.