Hii thanks for the reply.

Actually what i am trying to do is i have a file ListOfIpAdress.txt (please see below:) which i open and read it ($fhi do it in my code) i extract time from the string available.

ListOfIpAdress2.txt Address: 100.64.52.98 Time Fri Jan 16 21:44:35 2015 End Address: 100.65.0.172 Time Fri Jan 16 21:46:48 2015 End Address: 100.64.58.219 Time Fri Jan 16 22:56:16 2015 End Address: 100.65.5.25 Time Fri Jan 16 23:10:04 2015 End Address: 100.64.8.184 Time Fri Jan 16 23:52:54 2015 End Address: 100.65.13.135 Time Fri Jan 16 23:59:46 2015 End

Using my code i find the difference between the local time (current time and the time extracted from string).And in which ever line i get the time >36. I just ignore that line and read other lines and print them in ListOfIpAdress2.txt and then delete ListOfIpAdress.txt and Rename ListOfIpAdress2.txt to ListOfIpAdress.txt

This is what i wanted to achieve and still not able to achieve. Could you please help me ? My previous code is able to print extracted lines in ListOfIpAdress2.txt but it is not able to delete ListOfIpAdress.txt and rename it to ListOfIpAdress.txt.

Please alo let me know why it do not print"check1 and check2" again if in your c0ode i read the file like this " open my $fhi, '<', 'C:\shekhar_Axestrack_Intern\WindowCreation\ListOfIpAdress.txt', or die "Could not open file $!";"


In reply to Re^2: Why i am not able to print any statment after while loop by ppp
in thread Why i am not able to print any statment after while loop by ppp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.