use strict; use warnings; use Math::Complex; my @list = ( cplx(1, 8), 2 + 5*i ); print "List: @list\n"; foreach (@list) { print "$_\t-> re=", Re( $_ ), ", im=", Im( $_ ), "\n"; } #### List: 1+8i 2+5i 1+8i -> re=1, im=8 2+5i -> re=2, im=5