in reply to replace comma at the end of my query

Why use a regex when chop will do? Assuming, of course, you know the last character in your string will always be a comma.

Otherwise this will work:
$query =~ s/,$//;

Replies are listed 'Best First'.
Re: Re: replace comma at the end of my query
by PodMaster (Abbot) on May 09, 2003 at 22:10 UTC
    s/chop/substr/
    substr($query, -1,1)='' if substr($query, -1,1) eq ',';
    *note, I use substr($query, -1,1)='' instead of substr($query, -1,1,'') cause you never know how old the perl is ;)


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.