open my $memfh, '<', \$string; chomp(my @array = <$memfh>);