perlstu has asked for the wisdom of the Perl Monks concerning the following question:
if ( $fold =~m/.html$/) { open(FILE, $fold) || die "Cannot open File\n"; @lines=<FILE>; close (FILE); foreach $lines(@lines) { $lines=~s/http/https/g; #------------upper extent of HELP Here------------- + #convert html tags fromlower to upper #Whats wrong with match and extraction here ! if ($lines=~m/(<+)(\/?)(.+)(>+)/) {$tag=$3; $tag=~tr/a-z/A-Z/; } } #------------------------lower extent of help ----------- @log=@lines; open(FILE,">$fold") || die "cannot open file"; print FILE @lines; open(LOG,"+>>logfile.txt") || die "log file will not open!"; print LOG @log,"\n","#------newlog---------","\n"; close (LOG); close (FILE); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl html tag editing to uppercase
by grep (Monsignor) on Mar 31, 2002 at 07:34 UTC | |
by Anonymous Monk on Apr 11, 2002 at 08:30 UTC |