Re: Thread managment in Perl

2008-12-30 Thread perl pra
Hi All, I am trying out a jmeter like tool with perl.The following are the tasks that my perl script needs to do. 1) Fire specified number of http requests in one second. 2) log the response times of the request. 3) the Thread should be freed once it completes the task. The following are the is

Re: about "print"

2008-12-30 Thread John W. Krahn
xie ningde wrote: I'm a new perl user. I was trying to print an array by using print @array and print "@array". Is it supposed to output the same thing? I got the different output. EX: @array=qw/v1 v2 v3/, the output for print @array will be v1v2v3 while it will be v1 v2 v3 in the other case. The

function call

2008-12-30 Thread David Ehresmann
List, I have a factorial script that calls a sub fact that does the factorial and returns a value. But I get this error when I execute the script: Use of uninitialized value in numeric gt (>) at fact.pl line 22. Here is the script: #!/usr/bin/perl use warnings; use strict; fact(); my $num;

Re: function call

2008-12-30 Thread Mr. Shawn H. Corey
On Tue, 2008-12-30 at 07:10 -0600, David Ehresmann wrote: > I have a factorial script that calls a sub fact that does the > factorial and returns a value. But I get this error when I execute > the script: > > Use of uninitialized value in numeric gt (>) at fact.pl line 22. > > Here is the script

Re: function call

2008-12-30 Thread David Ehresmann
this works, thanks. I thought you had to declare the function before you called it? That is not right? #!/usr/bin/perl use warnings; use strict; my $num; print "enter a number: \n"; chomp($num = ); my $x = fact($num); print "the factorial is: $x\n"; sub fact { my $num = shift @_;

Re: function call

2008-12-30 Thread Jenda Krynicky
From: "Mr. Shawn H. Corey" > On Tue, 2008-12-30 at 07:10 -0600, David Ehresmann wrote: > > fact(); > > This calls the sub with an undef arguement. Just delete this line. No. It calls the sub with no arguments. fact(undef); would call it with an undef argument. > > my $num; > > > > print "e

Re: function call

2008-12-30 Thread Mr. Shawn H. Corey
On Tue, 2008-12-30 at 09:08 -0600, David Ehresmann wrote: > this works, thanks. I thought you had to declare the function before > you called it? That is not right? No, when you execute a Perl script, it is compiled before it is run. Therefore all subs are known before the script is run; they are

Re: Appending sequential numbers to a file, one number per line

2008-12-30 Thread Randal L. Schwartz
> ""Chas" == "Chas Owens" writes: "Chas> This one handles multiple files: "Chas> perl -pe '$.=1 && $o=$ARGV unless $o eq $ARGV; s/$/,$./' file1 file2 If you see perlvar, it hints at an easier way to reset $. from the perlfunc page under eof(): perl -pe 's/$,$./; close ARGV if eof;' file1

Re: function call

2008-12-30 Thread Chas. Owens
On Tue, Dec 30, 2008 at 10:08, David Ehresmann wrote: > this works, thanks. I thought you had to declare the function before > you called it? That is not right? snip No, but there are some benefits to doing so. For instance, if you don't use parenthesis with calls to functions perl hasn't seen

Re: function call

2008-12-30 Thread John W. Krahn
David Ehresmann wrote: List, Hello, I have a factorial script that calls a sub fact that does the factorial and returns a value. But I get this error when I execute the script: Use of uninitialized value in numeric gt (>) at fact.pl line 22. Here is the script: #!/usr/bin/perl use warnin

Re: Is there some IDE dedicated to perl?

2008-12-30 Thread Adam Jimerson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 sanket vaidya wrote: > > Instead of going for IDE It would be better to download Perl Interpreter & > use some editor. For Windows few editors are Crimson, Context, Perl Express > etc. I use Perl Express. > I played with Perl Express a bit and wasn'

Re: Is there some IDE dedicated to perl?

2008-12-30 Thread Mr. Shawn H. Corey
On Tue, 2008-12-30 at 11:50 -0500, Adam Jimerson wrote: > I played with Perl Express a bit and wasn't really happy with it, all > you really need is a text editor like others say and I have to put my > vote as +1 for VIM. > Both vim and gvim (gui-vim) work like vi. For a more modern version, use

Re: Is there some IDE dedicated to perl?

2008-12-30 Thread Francisco Valladolid
On Tue, Dec 30, 2008 at 5:36 PM, Mr. Shawn H. Corey wrote: > On Tue, 2008-12-30 at 11:50 -0500, Adam Jimerson wrote: >> I played with Perl Express a bit and wasn't really happy with it, all >> you really need is a text editor like others say and I have to put my >> vote as +1 for VIM. >> > > Both