At 15:25 -0400 1/11/11, Ronald J Kimball wrote:
On Tue, Nov 01, 2011 at 05:41:27PM +0100, John Delacour wrote:
Yes, just use a switch:
#! /usr/bin/perl
use strict;
my $switch_on;
while (<>) {
$switch_on = 1 if /<caption>/;
$switch_on = 0 if s/td>/th>/g;
print;
}
__END__
What is the purpose of $switch_on here? You set it, but you never do
anything with its value, so you might as well just do this:
#!/usr/bin/perl
use strict;
while (<>) {
s/td>/th>/g;
print;
}
__END__
You clearly have not followed the thread, and besides you have not
even read the script if you say I never do anything with the value of
$switch_on.
If a line contains "<caption>" $switch_on becomes true, so that the
succeeding line containing "td>"s has these replaced with "th>" and
the switch is consequently turned off until the next line containing
"<caption>" is encountered, and so forth.
What you are proposing is of no use to the original poster, as he has
already pointed out in his reply to Miraz Jordan.
Please read a thread before you repeat suggestions that have already
been rejected and make false statemnts about a solution that actually
works.
Jd
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>