Re: TEST

2005-10-04 Thread Tom Allison
Peter Scott wrote: On Tue, 04 Oct 2005 05:45:13 -0400, Tom Allison wrote: It seems that there really isn't any clear way to test a subroutine within a script and not a module. Besides loading it into a module and running everything from there -- any suggestions? I don't see it practical put

OS Vendor Neutral way to Join Process

2005-10-04 Thread Siegfried Heintze
There is a "join" feature for threads. Is there an OS Vendor neutral way to create multiple processes executing simultaneously with the parent and have the parent "join" on them like I can with threads? Thanks, Siegfried -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

Re: Deprecated perl hash reference statement problem

2005-10-04 Thread Tony Frasketi
Thanks to all who answered - I really appreciate the help! Now busy reading perldoc perlreftut ! Tony -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Deprecated perl hash reference statement problem

2005-10-04 Thread Timothy Johnson
Tony Frasketi wrote: >Both $hash->{$key} and $$hash{$key} work fine and this also works >Although I'm not sure why ${$hash}{$key}. There is a reason for this. Let's say you had two variables: %hash (a hash) $hash (a hash reference) You could confuse the interpreter if you wrote this:

Re: Deprecated perl hash reference statement problem

2005-10-04 Thread Jeff 'japhy' Pinyan
On Oct 4, Tony Frasketi said: Both $hash->{$key} and $$hash{$key} work fine and this also works Although I'm not sure why ${$hash}{$key}. The reason ${$hash}{$key} works is because it's a generalization of $$hash{$key}. The rule of thumb is: 1. start with $HASH{key} 2. replace HASH wit

Re: Deprecated perl hash reference statement problem

2005-10-04 Thread Tony Frasketi
Jeff 'japhy' Pinyan wrote: %hash->{$key} and @array->[$idx] are syntaces that you should not use. The fact that they work is due to intricacies of the Perl parser. Similarly, %{$hashref}->{$key} and @{$arrayref}->[$idx] are equally bad. Use $hash{$key} and $array[$idx] for normal hash and a

RE: Deprecated perl hash reference statement problem

2005-10-04 Thread Timothy Johnson
>Timothy Johnson wrote: > >>It depends on what you're trying to do. if $hashRef is a hash >>reference, then the correct syntax would be: >> >> $hashRef->{$key} = $value; >> >>or >> >> %{$hashRef}{$key} = $value; >> >>What you're saying below is something like: >> >>-- Take $hashRef and deref

Re: Deprecated perl hash reference statement problem

2005-10-04 Thread Jeff 'japhy' Pinyan
On Oct 4, Tony Frasketi said: sub get_form_data_1 { my($hashRef) = @_; my($buffer) = ""; my($key,$value,$pair,@pairs); if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; }else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } @pairs = split(/&/, $buffer); for

Re: Need help with Perl Book

2005-10-04 Thread Chris Devers
On Tue, 4 Oct 2005, Tom Allison wrote: > Bobby Jafari wrote: > > Hi All, > > > > I am looking for a suitable Perl Book to buy. I use Perl mainly for > > running test scripts on Telecommunications based products. I use > > Net::SNMP and Net::Telnet extensively. > > > > I also need a book on a go

Re: regd. executing one perl file inside another perl file

2005-10-04 Thread Chris Devers
On Tue, 4 Oct 2005, Dan Klose wrote: > If I have a script, in my case on my linux machine, and I want to run > that script using another script then I use the `` however you can use: > > #!/usr/bin/perl > > system("./my-script ") Why on earth would you do that? > #!/usr/bin/perl > > `./my_sc

Re: Deprecated perl hash reference statement problem

2005-10-04 Thread Tony Frasketi
Timothy Johnson wrote: It depends on what you're trying to do. if $hashRef is a hash reference, then the correct syntax would be: $hashRef->{$key} = $value; or %{$hashRef}{$key} = $value; What you're saying below is something like: -- Take $hashRef and dereference it to %HASH1 (I'm giv

Re: Deprecated perl hash reference statement problem

2005-10-04 Thread Jeff 'japhy' Pinyan
On Oct 4, Tony Frasketi said: I've used the following statement in several instances before and never had any errors reported and the programs all seem to work ok. %{$hashRef}->{$key} = $value; %hash->{$key} and @array->[$idx] are syntaces that you should not use. The fact that they work i

RE: Deprecated perl hash reference statement problem

2005-10-04 Thread Timothy Johnson
It depends on what you're trying to do. if $hashRef is a hash reference, then the correct syntax would be: $hashRef->{$key} = $value; or %{$hashRef}{$key} = $value; What you're saying below is something like: -- Take $hashRef and dereference it to %HASH1 (I'm giving it a name for cl

Deprecated perl hash reference statement problem

2005-10-04 Thread Tony Frasketi
Hello Listers I've used the following statement in several instances before and never had any errors reported and the programs all seem to work ok. %{$hashRef}->{$key} = $value; But since I've began using use strict; use warnings; use diagnostics; in my programs, I'm now starting

Re: STAT function; limit a log file.

2005-10-04 Thread Jay Savage
"Because it's up-side down". "Why is that?" "It makes replies harder to read." "Why not?" "Please don't top-post." - Sherm Pendley, Mac OS X Perl list On 10/4/05, Stephen Kratzer <[EMAIL PROTECTED]> wrote: > Chances are that the file size will never equal exactly 500 bytes. You cou

Re: regd. executing one perl file inside another perl file

2005-10-04 Thread Dan Klose
On Tue, 2005-10-04 at 19:55 +0530, [EMAIL PROTECTED] wrote: > Hi Dan > Could u plz elaborate ur logic in detail I think it might work.. > Mayank Ahuja Hi Mayank, You really need to work this out for yourself. You should try and submit some code so that people can correct you rather

Re: How to put html file's content into mail body and email it?

2005-10-04 Thread JupiterHost.Net
Franklin wrote: Hi; Hello, I have written a small email program which sends a simple email body which is "Test Text" and an attachment file whose name is test.htm. But I don't know how I can put the content of test.htm directly into the email's body and send it instead send the file via att

Re: STAT function; limit a log file.

2005-10-04 Thread Stephen Kratzer
Chances are that the file size will never equal exactly 500 bytes. You could use >= instead of eq, and it should work. Also, you don't have to close STDERR before reopening it, and in cases where you want to do numeric comparisons, use == instead of eq. Hope that helps a little. Also, it might

Re: regd. executing one perl file inside another perl file

2005-10-04 Thread Dan Klose
On Tue, 2005-10-04 at 15:31 +0530, [EMAIL PROTECTED] wrote: > Hi perlers > > Hello. > I have one query regarding how to execute one perl file with in the > another perl file. > The problem is like this I have to do 2-3 tasks by running 2-3 perl script > for each task ... in some o

STAT function; limit a log file.

2005-10-04 Thread Umesh T G
Hello List, #!/usr/bin/perl close(STDERR); open(STDERR,">/tmp/test.log") or die " Can't do it!!"; for($i=0; $i <=30; $i++) { print STDERR "print something in the file.\n"; ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat(STDERR); if ( $size eq '500' )

Re: TEST

2005-10-04 Thread Peter Scott
On Tue, 04 Oct 2005 05:45:13 -0400, Tom Allison wrote: > It seems that there really isn't any clear way to test a subroutine > within a script and not a module. Besides loading it into a module and > running everything from there -- any suggestions? I don't see it > practical putting a functio

How to put html file's content into mail body and email it?

2005-10-04 Thread Franklin
Hi; I have written a small email program which sends a simple email body which is "Test Text" and an attachment file whose name is test.htm. But I don't know how I can put the content of test.htm directly into the email's body and send it instead send the file via attaching. If you know it, would

Re: Array or arrays

2005-10-04 Thread John Doe
Jabir Ahmed am Dienstag, 4. Oktober 2005 07.48: ... use strict; # forces declaration of variables use warnings; # big help :-) ... > $file=$ARGV[0] || die "File not found $!"; > > my %uni=(); # %uni never used below my @record; > open (FH,"sort $fi

Re: Array or arrays

2005-10-04 Thread Philipp Traeder
On Tuesday 04 October 2005 07:48, Jabir Ahmed wrote: [..] > my @details=split('\t',$line); > [EMAIL PROTECTED]; > $reccnt+=1; [..] > > How do i read the values of @details trought the > $record array; > i want something like this > print $record[1][1] ==> this would refer to

regd. executing one perl file inside another perl file

2005-10-04 Thread mayank . ahuja
Hi perlers I have one query regarding how to execute one perl file with in the another perl file. The problem is like this I have to do 2-3 tasks by running 2-3 perl script for each task ... in some order say, for first order I have to run one perl file which give me one output

Re: Need help with Perl Book

2005-10-04 Thread Tom Allison
Bobby Jafari wrote: Hi All, I am looking for a suitable Perl Book to buy. I use Perl mainly for running test scripts on Telecommunications based products. I use Net::SNMP and Net::Telnet extensively. I also need a book on a good GUI Interface for Perl. Is TK a good option? What are other GUI

TEST

2005-10-04 Thread Tom Allison
This isn't a test message sent to the list, that would be lame. ;) However it's all about Testing and how to do it the right way. I've been trying to use Test::More as the cornerstone of my testing. This kind of falls into a pseudo-philosophical discussion of how to code but I'll try really ha

Re: somebody help me

2005-10-04 Thread Elie De Brauwer
The Roopak Times wrote: Hi All I'm just a beginner with perl. i was taking my initial lectures so i tried to make a program to slice a value from an array. the program was like this: use warnings; use strict; my @array; @array=qw( the quick brown fox ran over the lazy dog); print "$array(4)\n"

somebody help me

2005-10-04 Thread The Roopak Times
Hi All I'm just a beginner with perl. i was taking my initial lectures so i tried to make a program to slice a value from an array. the program was like this: use warnings; use strict; my @array; @array=qw( the quick brown fox ran over the lazy dog); print "$array(4)\n"; This program does not s