Cheers, j#!/usr/bin/perl use strict; use warnings; # file given as command line argument my $file = shift @ARGV; die "Usage: $0 <file.xml>\n" unless $file; # step 1: open the file open FH, "<", $file or die "Can't open '$file': $!\n"; # step 2: read the file line-by-line while (<FH>) { # step 3: do the replacements s/<(\/?)H([12])>/<$1Heading $2>/g; # step 4: write the results the STDOUT print; } close FH;
In reply to Re: Replacing XML Tag name with another
by reisinge
in thread Replacing XML Tag name with another
by sandy88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |