in reply to Sub Return Value Help

Change your substitution to:

$_=~s%<!-- (TBROWS) //-->%add_row()%eg;
I have changed the regex delimiters to make it easier to read

/J\

Replies are listed 'Best First'.
Re^2: Sub Return Value Help
by Anonymous Monk on Aug 01, 2005 at 15:44 UTC
    It worked, can you just explain your reg. exp. for me, thanks a lot!!!!

      The only difference (apart from changing the delimiters from '/' to '%' to reduce backslashing and improve readability) is that the /e modifier has been added to the substitution (meaning that perl code will be evaluated in the RHS of the substitution) and I have replace your variable with a call to the add_row() subroutine - for more on regular expressions please see the perlre manpage.

      /J\