To create a new file, use open.
open my $out, '>', 'new_file' or die $!;
If you just need to output the string, you can replace commas by newlines:
my $runTest = 'sydney,delhi,NY,Russia';
print {$out} $runTest =~ tr/,/\n/r;
Use say instead of print if you want a newline after Russia.
If you want to store the lines in an array, use split:
my @lines = split /,/, $runTest;
BTW, Sydney, Delhi, and NY are cities, while Russia is a country.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
|