in reply to Re: perl script to search and replace comment in .aspx file
in thread perl script to search and replace comment in .aspx file
#!/usr/bin/perl my $file_name = "test.txt"; my @aspxfiles=glob('.*aspx'); foreach $file(@aspxfiles) { open(INF,$file) || die "file could not open\n"; my @line; while(@line = <INF>) { if ( $line =~ s/<\/script/<\%\-\-<script/g) { open(INF,'>>$file_name') || die "could not open in writ +e mode"; close(INF); } close(INF); } }
this is partial coding which i tried.i'm very weak in scripting language
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: perl script to search and replace comment in .aspx file
by aaron_baugher (Curate) on Jun 07, 2012 at 17:29 UTC |