extern varibales

2004-09-24 Thread Christian Stalp
Hello together, I have this problem of global variables again. But in my case I need a varibale, a string, which should be known in all my modules. I put some of my functions out in modules which I call when I use them but all these functions also need some directory-pathes as strings. At the ti

Re: speed up string matching

2004-09-24 Thread c r
Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: C R wrote: > Gunnar Hjalmarsson wrote: >> C R wrote: >>> Are you certain that using the module makes the simultaneous >>> matching faster than a sequential and to what degree (roughly)? >> >> Certain? Certainly not. :) It depends, among other things,

Re: Calling Perl From Java?

2004-09-24 Thread Levon Barker
I have had to do this. Did a fair bit of research and the best that I could come up with (and what we have implemented) is to call mod_perl url from java. That way we don't have to recompile each time, and get some database persistance with Apache::DBI. Works out quite well. On Sep 23, 2004 04

Moving between hashes 2.

2004-09-24 Thread Michael Robeson
Gunnar, Thanks so much for the help and the links! They help quit a bit. I decided to use the if statement you posted: if ( $aa eq '-' ) { $hash3{$_} .= '---'; } else { $hash3{$_} .= substr $dna,0,3,''; } instead of: $hash3{$_} .= $

Help with putting a subroutine into a variable?

2004-09-24 Thread Gavin Henry
Hi all, I have this: - #!/usr/bin/perl use warnings; use strict; my @pics = <*.jpg>; my $website = 'http://www.website.com/uploads'; sub links { foreach (@pics) { print "$website/$_\n"; } } - I would normally call the subroutine like

SIGZERO

2004-09-24 Thread Errin Larsen
Hi Perlers, I'm trying to check on the status of a process by sending a SIGZERO to it with kill(). This SHOULD (according to the docs I've been reading) return false if the process died. But mine is not. It always returns true. if( kill 0 => $pid ) { print "the process is OK\n"; } else {

Re: SIGZERO

2004-09-24 Thread Errin Larsen
On Fri, 24 Sep 2004 09:17:58 -0500, Errin Larsen <[EMAIL PROTECTED]> wrote: > Hi Perlers, > > I'm trying to check on the status of a process by sending a SIGZERO to > it with kill(). This SHOULD (according to the docs I've been reading) > return false if the process died. But mine is not. It al

Re: Help with putting a subroutine into a variable?

2004-09-24 Thread Wiggins d Anconia
> Hi all, > > I have this: > > - > #!/usr/bin/perl > > use warnings; > use strict; > Good start. > my @pics = <*.jpg>; > my $website = 'http://www.website.com/uploads'; > > sub links { > foreach (@pics) { > print "$website/$_\n"; > } > } Your sub

RE: SIGZERO

2004-09-24 Thread Ed Christian
Errin Larsen wrote: > Hi Perlers, > > > if( kill 0 => $pid ) { > Forgive me if I presume too much, but shouldn't the above be: if( kill 0, $pid ) { perldoc -f kill -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Moving between hashes 2.

2004-09-24 Thread Gunnar Hjalmarsson
Michael Robeson wrote: I decided to use the if statement you posted: only because I had to add a $count++ function within the else statement (shown below) to accomplish another task within my larger script: if ( $aa eq '-' ) { $hash3{$_} .= '---'; } else {

RE: SIGZERO

2004-09-24 Thread Jenda Krynicky
From: "Ed Christian" <[EMAIL PROTECTED]> > Errin Larsen wrote: > > Hi Perlers, > > > > > > > > > if( kill 0 => $pid ) { > > > > > > Forgive me if I presume too much, but shouldn't the above be: > > if( kill 0, $pid ) { Those two are equivalent. perl -MO=Deparse -e "kill 0 => $pid

Re: SIGZERO

2004-09-24 Thread Errin Larsen
On Fri, 24 Sep 2004 10:31:36 -0400, Ed Christian <[EMAIL PROTECTED]> wrote: > Errin Larsen wrote: > > Hi Perlers, > > > > > > > > > if( kill 0 => $pid ) { > > > > > > Forgive me if I presume too much, but shouldn't the above be: > > if( kill 0, $pid ) { > > perldoc -f kill > Jenda is corr

RE: SIGZERO

2004-09-24 Thread Ed Christian
Errin Larsen wrote: > On Fri, 24 Sep 2004 10:31:36 -0400, Ed Christian <[EMAIL PROTECTED]> > wrote: >> Errin Larsen wrote: >>> Hi Perlers, >>> >> >> >> >>> >>> if( kill 0 => $pid ) { >>> >> >> >> >> Forgive me if I presume too much, but shouldn't the above be: >> >> if( kill 0, $pid ) {

Re: Help with putting a subroutine into a variable?

2004-09-24 Thread Gavin Henry
> Your sub breaks encapsulation because it relies on the fact that @pics > and $website are available in the sub but have not been passed into it. > Generally we want our subs to take arguments and return values. If you > were to move this sub to the top of the file or to another file (such as > a

Re: Help with putting a subroutine into a variable?

2004-09-24 Thread Gavin Henry
Wiggins d Anconia said: >> Hi all, >> >> I have this: >> >> - >> #!/usr/bin/perl >> >> use warnings; >> use strict; >> > > Good start. Courtesy of the Lama :-) >> my @pics = <*.jpg>; >> my $website = 'http://www.website.com/uploads'; >> >> sub links { >> foreach (@pics) {

Re: SIGZERO

2004-09-24 Thread Errin Larsen
Ok, I learned something else ... When I type: kill -9 on the command line, It's not actually killing the process. Let me explain. My script starts 3 others and then stays around watching them. So, when I run it, I get this: # ps -ef | grep dummy user1 18000 1 0 10:04:22 ?0:00 dummy_mon

Re: SIGZERO

2004-09-24 Thread Jenda Krynicky
From: Errin Larsen <[EMAIL PROTECTED]> > See that ""?! How did my process get a status? Is > that a Solaris-fancy way of saying "zombie-child"? I believe so. > The above explains > why my (kill 0 => $pid) isn't working the way I expect, but How can I > kill the kid. The child process final

Re: Help with putting a subroutine into a variable?

2004-09-24 Thread Wiggins d Anconia
> Wiggins d Anconia said: > > > > sub links { > >my ($base_url, @list) = @_; > >foreach my $element (@list) { > >print . > >} > >return; > > } > > Doesn't this still get the scalar and array from what I defined at the top? > No, note that I have changed the names (

Re: SIGZERO

2004-09-24 Thread Errin Larsen
On Fri, 24 Sep 2004 17:20:44 +0200, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: Errin Larsen <[EMAIL PROTECTED]> > > See that ""?! How did my process get a status? Is > > that a Solaris-fancy way of saying "zombie-child"? > > I believe so. > > > The above explains > > why my (kill 0 => $

Re: SIGZERO

2004-09-24 Thread Wiggins d Anconia
> From: Errin Larsen <[EMAIL PROTECTED]> > > See that ""?! How did my process get a status? Is > > that a Solaris-fancy way of saying "zombie-child"? > > I believe so. I do as well. > > > The above explains > > why my (kill 0 => $pid) isn't working the way I expect, but How can I > > kill

Re: SIGZERO

2004-09-24 Thread Errin Larsen
On Fri, 24 Sep 2004 10:34:50 -0500, Errin Larsen <[EMAIL PROTECTED]> wrote: > On Fri, 24 Sep 2004 17:20:44 +0200, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > From: Errin Larsen <[EMAIL PROTECTED]> <> > > how do I wait() or waitpid() on more than one process? don't both of > those make the wa

Re: SIGZERO

2004-09-24 Thread DBSMITH
I am a beginner, but I love to see all the knowledge transfer so keep the moderate to difficult questions coming! thanks, Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 Errin Larsen <[EMAIL PROTECTED]> 09/24/2004 11:44 AM Please respond to Errin Larsen To: Je

Re: SIGZERO

2004-09-24 Thread Wiggins d Anconia
> On Fri, 24 Sep 2004 10:34:50 -0500, Errin Larsen <[EMAIL PROTECTED]> wrote: > > On Fri, 24 Sep 2004 17:20:44 +0200, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > > From: Errin Larsen <[EMAIL PROTECTED]> > > <> > > > > > > how do I wait() or waitpid() on more than one process? don't both of >

Re: SIGZERO

2004-09-24 Thread Errin Larsen
On Fri, 24 Sep 2004 11:52:19 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am a beginner, but I love to see all the knowledge transfer so keep the > moderate to difficult questions coming! > <> I'm like you, Derek! I love just reading this stuff. Satisfies some inner-geek need I have

How do I get rid of ""

2004-09-24 Thread William Martell
Hi All, This "" is in a text file that I am working with. I am trying to remove it, but it seems to be a different character in different places throughout the text, even though to me, when viewed in Textpad text editor, it looks the same. Is there a special hex code or something that I c

How to check the FILE HANDLE STATUS ???

2004-09-24 Thread Madhu Reddy
hi, I want to check the status of File handle before reading/writing to file ? How to do this ? like following open(FH_IN_FILE, ">file.txt"); # This statement is executed by some other function close(FH_IN_FILE); print FH_IN_FILE "SOME DATA"; here before writing to file, i want to check

Re: How do I get rid of ""

2004-09-24 Thread Ajey Kulkarni
if you open the file in vi,say :%s/ctrl-v & ctrl-p//g You can check $line =~ s/ctrl-v ctrl-p//g; Mainly ^ = ctrl-v P = ctrl-p regards -Ajey On Thu, 23 Sep 2004, William Martell wrote: > Hi All, > > This "" is in a text file that I am working with. I am trying to > remove it, b

Re: XMLin() not finding XML::SAX or XML::Parser modules Problem

2004-09-24 Thread Ajey Kulkarni
I installed the expat libs,but the cpan shell is now asking for EXPATLIBPATH and EXPATINCPATH. It says perl Makefile.PL Now,how do i specify these paths for XML::Module installation?? Where is this Makefile.PL file? Regards again -Ajey On Thu, 23 Sep 2004, Chris Devers wrote: > Please send

Re: How to check the FILE HANDLE STATUS ???

2004-09-24 Thread Wiggins d Anconia
> hi, >I want to check the status of File handle before > reading/writing to file ? How to do this ? > > like following > > open(FH_IN_FILE, ">file.txt"); > Which itself is a bad idea, always check that the open succeeded in the first place, open FH_IN_FILE, ">file.txt" or die "Can't open f

Re: XMLin() not finding XML::SAX or XML::Parser modules Problem

2004-09-24 Thread Chris Devers
On Fri, 24 Sep 2004, Ajey Kulkarni wrote: > I installed the expat libs,but the cpan shell is now asking > for EXPATLIBPATH and EXPATINCPATH. Oh. That. Yeah, that's a pain. The first thing is to get Expat installed, which I forgot about before. Instructions for this will vary depending what OS y

Re: XMLin() not finding XML::SAX or XML::Parser modules Problem

2004-09-24 Thread Wiggins d Anconia
> On Fri, 24 Sep 2004, Ajey Kulkarni wrote: > > > I installed the expat libs,but the cpan shell is now asking > > for EXPATLIBPATH and EXPATINCPATH. > > Oh. That. Yeah, that's a pain. > > The first thing is to get Expat installed, which I forgot about before. > Instructions for this will vary d

Re: How to check the FILE HANDLE STATUS ???

2004-09-24 Thread Dave Gray
> open(FH_IN_FILE, ">file.txt"); > > # This statement is executed by some other function > close(FH_IN_FILE); > > print FH_IN_FILE "SOME DATA"; > > here before writing to file, i want to check the > status of FH_IN_FILE..(whether file is opened or > closed ) You could do something like the foll

Re: Daemon that starts other Daemons

2004-09-24 Thread Bob Showalter
Errin Larsen wrote: > Ok ... so with some research and playi^H^H^H^H^Htesting I've found the > answer to what's really been bothering me. If you *really* want to understand the nuts and bolts of all this, Stevens' _Advanced Programming in the UNIX Environment_ is a must. http://www.amazon.com/exe

Re: How to check the FILE HANDLE STATUS ???

2004-09-24 Thread John W. Krahn
Madhu Reddy wrote: hi, Hello, I want to check the status of File handle before reading/writing to file ? How to do this ? like following open(FH_IN_FILE, ">file.txt"); # This statement is executed by some other function close(FH_IN_FILE); print FH_IN_FILE "SOME DATA"; here before writing to f

Re: How do I get rid of ""

2004-09-24 Thread John W. Krahn
William Martell wrote: Hi All, Hello, This "" is in a text file that I am working with. I am trying to remove it, but it seems to be a different character in different places throughout the text, even though to me, when viewed in Textpad text editor, it looks the same. Is there a special he

Re: Daemon that starts other Daemons

2004-09-24 Thread John W. Krahn
Bob Showalter wrote: Errin Larsen wrote: Ok ... so with some research and playi^H^H^H^H^Htesting I've found the answer to what's really been bothering me. If you *really* want to understand the nuts and bolts of all this, Stevens' _Advanced Programming in the UNIX Environment_ is a must. http://www

How to return 'k'-cliques in a graph

2004-09-24 Thread Edward WIJAYA
Dear all, I have a following code that find a "k-clique" within a graph. k-Clique is a complete subgraph of size 'k'. (Please see the attached picture). Currently running this code gives: $ perl graph.pl 3 5 6 9 $ perl graph.pl 4 1 2 3 4 As you can see the code below only return the