Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.

by pvaldes (Chaplain)
on Jan 08, 2015 at 13:17 UTC ( #1112639=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $tp = Time::Piece->strptime($1, DATE_FORMAT);
    # out the replacement line
    print "tp is: $tp\n"; # we check $tp values here, just for the record
    
    ($tp+ONE_MINUTE*2*$n)->strftime(DATE_FORMAT);
    
  2. or download this
    $tp = $tp+ONE_MINUTE*2*$n;
    print "tp is now: $tp\n"; # we check $tp again after the changes
    
    $lines[1] =~ 's{:20140924105028(\d+)}'{$tp}e; 
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1112639]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2019-11-22 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (113 votes). Check out past polls.

    Notices?