my @lines=split( /\n/, $storage_string); print "@lines\n"; # or since $storage_string contains embedded newlines, just printing it would work print "$storage_string\n";