Re: speeding up a perl script

2008-01-23 Thread lerameur
On Jan 22, 7:18 pm, [EMAIL PROTECTED] (Paul Johnson) wrote: > On Tue, Jan 22, 2008 at 05:52:35PM -0500, Chas. Owens wrote: > > On Jan 22, 2008 2:58 PM, lerameur <[EMAIL PROTECTED]> wrote: > > > Hello, > > > > I wrote a short perl script (65 lines), simply to

speeding up a perl script

2008-01-22 Thread lerameur
Hello, I wrote a short perl script (65 lines), simply to count some log file time, and take the average. The script takes 4 minutes to run and go through about 8 millions lines. I would like to know if I can make it run faster. Why?, if I use the command 'wc -l filename' , I get the number of li

Use of uninitialized value in numeric ne error

2007-12-21 Thread lerameur
Hello and cheers to all, I wrote a small program and it does work, but I get this error message every tim I run the script: Use of uninitialized value in numeric ne (!=) at ./reverse_string.pl line 11. basically it is a menu and when the user type 99 as a choice, the program ends line 11 is: whi

Re: error on simple system command

2007-11-27 Thread lerameur
works good now: my $file_to_print = ( `ls -1c /test/*log | tail -1 `); print "file_to_print: $file_to_print"; open (FILE, "< /test/$file_to_print") or die "Could not open file_to_print $: $!"; although the third line is not opening the file. It prints out good but but I

error on simple system command

2007-11-26 Thread lerameur
Hello, I am trying to use this two line script. The command by itself works, when I run this script, I get error message: Use of uninitialized value in concatenation (.) or string at ./ find_date.pl line 8. line 8: my $file_to_print = system "ls -lrt /test/*log | tail -1 | awk {'print $9'}";

using lenght

2007-11-16 Thread lerameur
hello, I have a small function using lenght, I am getting the following error: Use of uninitialized value in length at ./count2.pl line 95, < $wordlisting1> line 1. while (my $line = <$wordlisting1> ) { if ($line =~ m/backlog/ ) { my @items = (split(/,/,$line))[0..88];

Re: SSH with PERL

2007-11-02 Thread lerameur
On Nov 1, 9:29 pm, [EMAIL PROTECTED] (Tom Phoenix) wrote: > On 11/1/07, lerameur <[EMAIL PROTECTED]> wrote: > > > I wrote a small script, the manual upload of a file works, but gives > > me an error message:unable to initialize mechanism library [/usr/lib/ > > gss/g

SCP::NET 'put' error

2007-11-01 Thread lerameur
Hello, I wrote a small program to test the SCP function. The program simply outputs Died at line 44, which is the line for the put function my $file_to_put =''test.txt'' ; $SCP->put($file_to_put) or die $SCP->{errstr}; is the problem on putting the actual file, or is it more on finding tha

SSH with PERL

2007-11-01 Thread lerameur
hello, I wrote a small script, the manual upload of a file works, but gives me an error message:unable to initialize mechanism library [/usr/lib/ gss/gl/mech_krb5.so] Could some tell me what this is about? it does end up transferirng the file. thanks /tom/ken>scp test.txt tacoma:/export/home/ken

unix commands

2007-09-20 Thread lerameur
Hello, I want to write a perl script that invokes unix command. Some of the command can take a long time to process, I have many commands I want to invoke. Lets say the first command can take one minute to process, how can I make sure the second command will not start until the irst one is comp