User Profile

Collapse

Profile Sidebar

Collapse
alampally
alampally
Last Activity: Jul 16 '08, 10:25 AM
Joined: Jul 16 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • alampally
    replied to How to sort the data?
    in Perl
    Hi Lilly,


    Good Luck,

    Write me for any help in C, C++, Perl, PHP and UNIX related stuff. I will answer you with in the time with free of cost.

    Rammohan Alampally,
    HP Technologies
    Bangalore
    See more | Go to post
    Last edited by eWish; Jul 17 '08, 03:36 AM. Reason: Please do not use BOLD tags for your entire post.

    Leave a comment:


  • alampally
    replied to Problem replacing the string
    in Perl
    HI Ramesh,

    Have a look at the following sample code and you can replace what I have placed for you....

    Snippet#1
    Code:
    $string1 = "I love to eat apples all day. I can eat apples every day! Apples are yummy!";
    $string1 =~ s/apples/oranges/g;
    print "The resulting value is : $string1 \n";
    Snippet#2
    Code:
    $string1 = "today is the best day of all";
    ...
    See more | Go to post

    Leave a comment:


  • alampally
    replied to Delete a line from file
    in Perl
    Code:
    ######################################
    # subroutine delete file
    ######################################
    
    sub Delete
    {
    
    $out="cgi-bin/order/$ENV{'REMOTE_ADDR'}.txt";
    
    open OUT, "$out" or die "Cannot open $out for write :$!";
    
    read(OUT,$oldstuff,10000);
    
    close OUT;
    
    @changes=split(/n/,$oldstuff);
    ...
    See more | Go to post

    Leave a comment:


  • alampally
    replied to find the *.log files with age and delete
    in Perl
    Code:
    #!/usr/local/bin/perl
    use strict;
    foreach (glob ("C:\\Ram\\Bangalore\\Log\\*.log"))
    {
    	my $result = -M;
    	if ($result > 4)
    	{
    		print "$_ is over 4 days old...removing\n";
    		unlink $_;
    	} 
    }
    Comments:
    Hi Venkat,
    This script will automatically delete all log files whose age is more than 4days from the mentioned folder....
    See more | Go to post

    Leave a comment:


  • alampally
    replied to find the *.log files with age and delete
    in Perl
    Code:
    #!/usr/local/bin/perl
    use strict;
    foreach (glob ("C:\\Ram\\Bangalore\\Log\\*.log"))
    {
    	my $result = -M;
    	if ($result > 7)
    	{
    		print "$_ is over 7 days old..removing\n";
    		unlink $_;
    	} 
    }
    Comments:
    This script will automatically delete all log files whose age is more than 7days from the mentioned folder.

    Write...
    See more | Go to post
    Last edited by numberwhun; Jul 16 '08, 11:47 AM. Reason: Please use code tags

    Leave a comment:

No activity results to display
Show More
Working...