Hi All, I have an entire HTML template stored in $text. I want to use a RE to extract blocks of marked text, then perforn RE's on that block line by line in a subroutine (&selection) and substitute that back into $text, i.e:
<snip> $text =~ s{ <!--field--> ( .*? ) <!--end--> } { &selection( $1 ) }gsex; .. sub selection { my ( $name, $checked ); my $text = shift; my $mod_text; for ( split /\n/, $text ) { { m/name\s*=\s*"*(\w+)"*/; $1 and $name = $1; # } $mod_text .= "$_\n"; } return $mod_text; } The problem I seem to be having is with the declaration that __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com