in reply to Embeded Data vs Data File

You split on the newline character with the embedded data, but the newline character is present at the end of your lines when you read from the data file. chomp will fix this:

my @horiz = <STDIN>; chomp( @horiz ); my @dates = split /\|/, shift @horiz;