in reply to regex search and replace issue

Just to flesh out Utilitarian's answer:
if ($Message =~ /^db /i) { print "Content-type:text/html\n\n"; print "c=$Message<br>\n"; $Message =~ s/^db //i; print "[m=$Message]\n"; exit; }

Replies are listed 'Best First'.
Re^2: regex search and replace issue
by hbm (Hermit) on Nov 11, 2011 at 14:29 UTC

    Or, since you're exiting and therefore don't need the modified $Message further down, just capture any trailing stuff and print once:

    if ($Message =~ /db (.*)/i){ print "Content-type:text/html\n\n", "c=$Message<br>\n", "[m=$1]\n"; exit; }