RE: HoH is there a better way?

2004-11-09 Thread Charles K. Clarkson
Simplicidade.com <[EMAIL PROTECTED]> wrote: : Probably this is not better and it's not what you want. : Take it as an alternative ;-) : : It's an Array of Hashes. : It gets the column headers from the first row of __DATA__. : When you have fixed length columns 'unpack' is a good choice. : For thi

Re: HoH is there a better way?

2004-11-09 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson wrote: You may want to remove the field names from the database, to avoid the need to test for them at each iteration. Optionally you can extract the field names from the first line of the database rather than hardcode them: sub tabinfo_hash { my @elems = ( split '

Re: HoH is there a better way?

2004-11-09 Thread Gunnar Hjalmarsson
Richard Kofler wrote: My sub does, what I expect it to do, but somehow it does look clumpsy to me, when compared to code from the knowing ones in c.l.p.m :) Not sure why you say that. To me, it seems to be an appropriate approach. I'd apreciate it very much, if someone could hint me into better wa

RE: Why doesn't this work?

2004-11-09 Thread Ajey Kulkarni
If you are running this on *NIX box, plain old 'find' command is enough too. ~A On Tue, 9 Nov 2004, Jim wrote: > > > The following subroutine should take an input path (Dir0), > > process that directory by recursively calling itself on > > subdirectories or processing any files it contains. T

RE: Why doesn't this work?

2004-11-09 Thread Jim
> The following subroutine should take an input path (Dir0), > process that directory by recursively calling itself on > subdirectories or processing any files it contains. The > problem I am experiencing is that in the following example > file structure it process Dir1 correctly, but after

RE: Reading external file and writing out individual files

2004-11-09 Thread Jim
> How would I go about reading in an external file and then > based on the search criteria write out individual files. > Basically I want to split one big chunk into smaller chunks. > > The file gets opened and then I want to search for the first > occurence of and pickup up everything until I

Re: HoH is there a better way?

2004-11-09 Thread Simplicidade.com
Probably this is not better and it's not what you want. Take it as an alternative ;-) It's an Array of Hashes. It gets the column headers from the first row of __DATA__. When you have fixed length columns 'unpack' is a good choice. For this example I'm not using __END__ at the end of __DATA__ :-)

Installing Tk

2004-11-09 Thread Tibbals, David
While attempting to install the TK804 module on my system I get the following error: " LD_RUN_PATH="/usr/X11R6/lib:/lib64" gcc -shared Tk.o chnGlue.o evtGlue.o objGlue.o tixGlue.o tkGlue.o tkGlue_f.o tkWin32Dll.o -o blib/arch/auto/Tk/Tk.so pTk/libpTk.a -L/usr/X11R6/lib -lX11 -lnsl -lm /usr/bin/ld:

HoH is there a better way?

2004-11-09 Thread Richard Kofler
down Here is what I've got so far (pasted after successful test) #!/usr/bin/perl use warnings; use strict; use diagnostics; # testscript showing use of hoh # RK 20041109 V01 initial version sub tabinfo_hash { # t_info file into hash tih # # Input #

Why doesn't this work?

2004-11-09 Thread Li, Aiguo (NIH/NCI)
Hello, I have the following dataset and want to calculate a P/A ratio for each replicates in the dataset. In this case, treatment 1 has 4 replicats and treatment2 has 3 replicates. The P/A = [((#of P)*2) + (# of M)]/# of replicates. The output should be two columns of P/A ratios for two treatment

Re: Problem com var on a require...

2004-11-09 Thread David Greenberg
I don't want to begin to understand why you're doing this, but if you make a.pl read: #!/usr/bin/perl $test = 'World!'; require 'b.def'; print $abacus; it should work. If you mean for b.def to define some standard functionality, try defining subs in it instead. -David On Tue, 9 Nov 2004 17:48:

Problem com var on a require...

2004-11-09 Thread Jair V. B. Junior
Hi all, here comes a little confusing question :-) a.pl: #!/usr/bin/perl require 'b.def'; $test = 'World!'; print $abacus; b.def: $abacus = "Hello $test"; When I run it: $ perl a.pl Hello Why is this going wrong? Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: A regex problem.

2004-11-09 Thread William C. Bruce
[EMAIL PROTECTED] (Denham Eva) wrote in news:[EMAIL PROTECTED]: > Hello Gurus, > In a script I have a piece of code as such:- > * snip** > my $filedate =~ s/(\d+)//g; > * snip end *** > The data I am parsing looks as such :- > ** DATA >

Re: using $. line number special variable (followup)

2004-11-09 Thread Paul Johnson
On Tue, Nov 09, 2004 at 11:40:30AM -0600, Joseph Paish wrote: > BTW, i think i may have found out what is giving me the strange line numbers > in the debugger under emacs. it seems that when i enter "p $." at the > debugger prompt, it displays whatever line number the debugger just printed > o

Perl and win32::ole

2004-11-09 Thread Rok Jaklic
Hi. I would like to copy and then paste multiple times some lines of text from .doc file to some other location and I wonder if someone has some piece of example code? Best regards, Rok -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: using $. line number special variable (followup)

2004-11-09 Thread Joseph Paish
On Tuesday 09 November 2004 10:20, Christopher Maujean wrote: > On Tue, 2004-11-09 at 07:24, Joseph Paish wrote: > > just a short followup to my earlier message about the $. line number > > variable. when i enter a print statement as shown below, it prints the > > correct line number (starting at

Re: using $. line number special variable (followup)

2004-11-09 Thread Joseph Paish
On Tuesday 09 November 2004 08:41, Bob Showalter wrote: > Joseph Paish wrote: > > just a short followup to my earlier message about the $. line number > > variable. when i enter a print statement as shown below, it prints > > the correct line number (starting at 1), but still never enters the > >

Re: using $. line number special variable (followup)

2004-11-09 Thread Christopher Maujean
On Tue, 2004-11-09 at 07:24, Joseph Paish wrote: > just a short followup to my earlier message about the $. line number > variable. when i enter a print statement as shown below, it prints the > correct line number (starting at 1), but still never enters the if() > structure. > > for the sa

Why doesn't this work?

2004-11-09 Thread Brian Gehrke
The following subroutine should take an input path (Dir0), process that directory by recursively calling itself on subdirectories or processing any files it contains. The problem I am experiencing is that in the following example file structure it process Dir1 correctly, but after it returns t

RE: using $. line number special variable (followup)

2004-11-09 Thread Bob Showalter
Joseph Paish wrote: > just a short followup to my earlier message about the $. line number > variable. when i enter a print statement as shown below, it prints > the correct line number (starting at 1), but still never enters the > if() structure. > > for the sake of understanding how to correctl

Re: using $. line number special variable (followup)

2004-11-09 Thread Joseph Paish
just a short followup to my earlier message about the $. line number variable. when i enter a print statement as shown below, it prints the correct line number (starting at 1), but still never enters the if() structure. for the sake of understanding how to correctly use this variable, i wou

RE: Best place to put collection of subroutines in a program

2004-11-09 Thread Bob Showalter
Edward WIJAYA wrote: > Hi, > > Would like to know, where is the best place to > put collection of subroutines in a Perl program, > is it after "main" or before? Any caveat? I generally put the "main" code at the top and subs below. Perl doesn't care unless you want to call a sub without parens, i

Re: Best place to put collection of subroutines in a program

2004-11-09 Thread Chris Devers
On Tue, 9 Nov 2004, Edward WIJAYA wrote: > Would like to know, where is the best place to > put collection of subroutines in a Perl program, > is it after "main" or before? Any caveat? It's more a matter of style than anything else. I like having the main block up front, and the subroutines aft

Best place to put collection of subroutines in a program

2004-11-09 Thread Edward WIJAYA
Hi, Would like to know, where is the best place to put collection of subroutines in a Perl program, is it after "main" or before? Any caveat? -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: P/A ratio

2004-11-09 Thread Chris Devers
Perl is case-sensitive, so everywhere that you've capitalized a command, you've got a statement that won't work. So to cite some examples: On Tue, 9 Nov 2004, Li, Aiguo (NIH/NCI) wrote: > Use strict; > Use warning; > > My @split; > My @replicate = ( 4, 3); > My @ratio; > My $p=0, $m=0, $a=0, $r

P/A ratio

2004-11-09 Thread Li, Aiguo (NIH/NCI)
Hi, all. I have the following dataset and need to calculate a P/A ratio for each replicates in the dataset. In this case, treatment 1 has 4 replicats and treatment2 has 3 replicates. The P/A = [((#of P)*2) + (# of M)]/# of replicates. The output should be two columns of P/A ratios for two treatme

Reading external file and writing out individual files

2004-11-09 Thread FlashMX
Hi, How would I go about reading in an external file and then based on the search criteria write out individual files. Basically I want to split one big chunk into smaller chunks. The file gets opened and then I want to search for the first occurence of and pickup up everything until I hit (the

Re: how to pass array and variable

2004-11-09 Thread Edward WIJAYA
On Tue, 9 Nov 2004 09:28:10 -, Murphy, Ged (Bolton) <[EMAIL PROTECTED]> wrote: Ajey Kulkarni wrote: Hmmm...Whenever you pass array AND a variable with array being first, the subroutine takes the variable and appends to array. Make sure you pass var first,followed by array. There is no need

RE: how to append test to file

2004-11-09 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi Frnds, > I myself found some way.Read the file to an array and created a file > as > per requirement and then inserted the objects in the array to file. > > for ($i=0;$i < $#arr;$i++) > { > print OUTPUT $arr[$i]; > } > ==

IO::Seekable::getpos missing

2004-11-09 Thread Claudio Bley
Hello all. I recently had to exchange my hard drives and I just copied all the files over. Now, for this very simple script: "use FileHandle;" I get the following error: IO::Seekable::getpos missing at /usr/share/perl/5.8/FileHandle.pm line 59. How can this happen? I already re-installed per

RE: how to append test to file

2004-11-09 Thread arjun.mallik
Hi Frnds, I myself found some way.Read the file to an array and created a file as per requirement and then inserted the objects in the array to file. for ($i=0;$i < $#arr;$i++) { print OUTPUT $arr[$i]; } = Arjun -Origina

RE: how to pass array and variable

2004-11-09 Thread Murphy, Ged (Bolton)
Ajey Kulkarni wrote: > >Hmmm...Whenever you pass array AND a variable with array being first, >the subroutine takes the variable and appends to array. > >Make sure you pass var first,followed by array. There is no need to >complicate with the array ref IMHO. What if you want to pass 2 or more arr

Need help .

2004-11-09 Thread Allen\(哲民\)
Hi, Could anyone give me a solution to solve this problem ? [PERL under Linux]# perl -MO=C,-owin32.c win32_exec.pm Base class package "Msf::PayloadComponent::Win32Execute" is empty. (Perhaps you need to 'use' the module which defines that package first.) at win32_exec.pm line 12 BEGIN failed--

RE: how to append test to file

2004-11-09 Thread arjun.mallik
Hi , Can any suggest some thing for my problem, like I need to append to a file from last but one line of the existing file. Ex: if a file has 6 lines then appending should be done from 6th line Thanks in advance Arjun -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PRO

Re: How to get text after comment

2004-11-09 Thread Eva Perales Laguna
> if ($line1 =~ /^#\(.*\)/) When you put a \ before an special character, like (, this special character losts its special behaviour. So, in your regex, the bracket acts as a normal character and the regex looks for something that contains brackets. If you want to capture the substring afte

ActiveState 5.6 missing DBI & ODBC

2004-11-09 Thread Jerry Preston
I am trying to add the ppm DBI/ODBC for ActiveState Perl v5.6.1 for sun-polaris-thread-multi server. I need to be able to access ORACLE data base, but I can only find DBI/ODBC for 5.8. When I do ppm install DBI it get the following: it is not for this build of Perl. I have looked all over th