in reply to Parse messy string into neat data structure

Wrong sigil for @images[0].
split takes a regex. There's no reason to use a string literal.
Needless code duplication.

my @images = map { [ /\w+\.jpg/gi ] } split /\|/, $str;