you probably just need to add the arrow operator because you have what looks like an array of arrays:

@pics = sort { $a->[2] cmp $b->[2] } @pics;

but the sort will may not work well anyway. using "cmp" to sort yyyy-mm-dd isn't going to return what you expect. Neither is using <=> since I believe the sort will stop at the first dash '-' in the date format. To get an accurate sorting of a date in that format you probably have to convert it back to epoch time and use <=> to sort it.