Jason Tiller wrote:
> ...
> #!/usr/bin/perl
>
> # Store the text you provided in your e-mail as a big string.
> $text = <<BOB;
> ....
> # Remove new lines, splitting into an array.
> @text = split( "\n", $text );
>
> # Now weld the string back together, with spaces instead of newlines!
> $text = join( " ", @text );
>
> # Find the string bounded by "<select " and "/select>". The '.+?'
> # finds all characters but isn't greedy; ".+" would match all of the
> # characters between the first "<select " and the *last* "/select>".
> # Store this match as $1.
> while( $text =~ /(<select .+?\/select>)/ )
> { # Use the backreference $1, replacing the matched string with "!x!".
> $text =~ s/$1/!x!/;
> }
>
> # Print out the modified string.
> print "$text\n";
>
It should be a little bit easier:
Try $text =~ s{<select .+?/select}
{!x!}gs;
print $text,"\n";
Best Wishes,
Andrea.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]