Donna, 24 years of age, born Ipswich at 8.00pm,
Donna,
24 years of age,
born Ipswich at 8.00pm,
The first bit of code will read
my $text = $ARGV[0]
$text =~ s/[a-z],\n/i;
print $text. "/n";
I am trying to replace text with commas and put them into a list like above.
Can anyone help me with this script or suggest any better ideas?
$text =~ s/[a-z],\n/i;
the above regexp should throw an error.
and the line below is not printing a newline:
print $text . "/n";
This is waht you want:
$ARGV[0] = 'Donna, 24 years of age, born Ipswich at 8.00pm,';
my $text = $ARGV[0];
$text =~ s/([a-z], )/$1\n/gi;
print "$text\n";