in reply to help with the diamond operator

try this: change  print <$foo>; to  print $_;