dhudnall has asked for the wisdom of the Perl Monks concerning the following question:
the file is basically editing a webpage that constantly updates logfiles for viewing. When a new month approaches I must login to this page and add a new#!/usr/bin/perl -w #tells PERL to display warnings for syntax #This section will contain the listing of variables #this is the string for the break command my $file_name = shift; #This is the file to read in my $break_name = shift; #This is the string we are looking for my $counter1=0; #This is a simple counter #This will open the main.html file to read in information open(INFILE, $file_name) or die "Can't open file\n"; while(<INFILE>){ #until we print a break until($counter1=1) { #if you see a break <br> if (/$break_name/) #if you locate a the first bre +ak { #enter onto a new line and place another break #CODE GOES HERE #increment counter to 1 so it doesn't continue + doing it $counter1++; }#end if }#end of until }#end of while loop
Each month the MONTH and YEAR in both places of the string must be replaced. I didn't know of an easy way to locate that line, perhaps call a formated date function, or what. If you have any thoughts of an easy way to do this please give me your feedback thanks.<li><a href="SERVER072007/intranet.htm" target="_blank">Jul 2007</a>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string automation
by daseme (Beadle) on Aug 06, 2007 at 23:02 UTC | |
|
Re: string automation
by ww (Archbishop) on Aug 07, 2007 at 03:27 UTC |