in reply to Eliminating last comma

I'm assuming $myNames = 'Jones, Smith, Baker, Johnson,'

The regular expression then becomes:

my $myNames = 'Jones, Smith, Baker, Johnson,'; $myNames =~ s/,$//; # replace comma at the end of the string with empt +y string print "$myNames\n";

Replies are listed 'Best First'.
Re^2: Eliminating last comma
by Anonymous Monk on Jun 21, 2006 at 13:21 UTC
    You people on here are quick!

    Thanks!!