Re: Is there a way to get a PID from a process name?

2004-05-12 Thread Ramprasad A Padmanabhan
On Thu, 2004-05-13 at 07:03, Michael Terry wrote: > Hi, > > I've got this shell script: > > #!/bin/sh > ps axc|awk "{if (\$5==\"$1\") print \$1}"; > > ... which gets a PID if you feed it the process' name. Is there a way > to translate this into Perl using a standard Perl distribution? I mean,

Perl::Optomizer

2004-05-12 Thread JupiterHost.Net
Hello list, Perl::Tidy is very excellent for making source look nice. I was wondering if anyone knew of anything that is the same type of idea but it optomizes your Perl code to run a bit faster: for instance: $newvariable = "$howdy"; should be: $newvariable = $howdy; and $stuff = "hell

RE: How to find files in subdirectory

2004-05-12 Thread Tim Johnson
Check the documentation for the File::Find module. It comes standard with most Perl distributions. -Original Message- From: LK Tee [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 6:52 PM To: '[EMAIL PROTECTED]' Subject: How to find files in subdirectory Hi, I'm perls beginner

How to find files in subdirectory

2004-05-12 Thread LK Tee
Hi, I'm perls beginner now, I have a problem when create a script find all file in subdirectory that have the same filename. How I write the script using perl and return the result like below: File1: ~/A/File~/A/AA/file1 ~/A/C/CC/CCC/file Kuan.

RE : DBD for SQL Server?

2004-05-12 Thread Jose Nyimi
> -Message d'origine- > De : Richard Crawford [mailto:[EMAIL PROTECTED] > Envoyé : mercredi 12 mai 2004 22:17 > À : NYIMI Jose (BMB) > Cc : Alok Bhatt; [EMAIL PROTECTED] > Objet : Re: DBD for SQL Server? > > NYIMI Jose (BMB) wrote: > > > > >>-Original Message- > >>From: Alok Bha

Is there a way to get a PID from a process name?

2004-05-12 Thread Michael Terry
Hi, I've got this shell script: #!/bin/sh ps axc|awk "{if (\$5==\"$1\") print \$1}"; ... which gets a PID if you feed it the process' name. Is there a way to translate this into Perl using a standard Perl distribution? I mean, without calling 'ps'; I've learned enough Perl now to be able to do

simulating bash

2004-05-12 Thread Andrew Gaffney
As part of a program I'm writing, I need to read some variables from a bash script and do some bash-style interpolation. My current code: sub get_depend { my $ebuildfname = shift; my $ebuildcontents; my %ebuildvars; my $pkgname = $ebuildfname; $pkgname =~ s|/usr/portage/||; $pkgname =

Re: WWW::Mechanize question / array values

2004-05-12 Thread JupiterHost.Net
Next and hopefully last question for now on a more general subject: Why do array members take the form of 'ARRAY(0x90df74)' rather than the actual content fed to an array or variable? Whatever variable looks like that when printed if an array reference. for(@links) { print @{$_}; } see perldoc p

Re: dependency tree

2004-05-12 Thread Jeff 'japhy' Pinyan
On May 12, Andrew Gaffney said: >> This sounds like postorder tree traversal to me: > >I've seen that term before when looking into this, but I don't know what >it means. I'd suggest bookmarking the wikipedia, it has a lot of encyclopedia-style definitions (read, long texts and examples) of compu

Re: form based htaccess logins

2004-05-12 Thread Kevin Old
On Wed, 2004-05-12 at 17:34, [EMAIL PROTECTED] wrote: > Hello. > > I'm looking for a script, and definitly willing to roll my own, that > interacts with htaccess. It is quite simple to validate user input against > the .htpasswd file and authenticate them into a given directory. But i > need Apa

Resources for VB.NET integration

2004-05-12 Thread John Goodleaf
I'm now working in an environment in which I'll have to deploy VB.NET apps (don't blame me). Anyway, I have some perl stuff I'd like not to reinvent in VB, dealing with database reporting. Are there any good resources that will show me how I might deploy a VB-based form that actually runs a Perl pr

Re: WWW::Mechanize question / array values

2004-05-12 Thread Ben Miller
On 5/12/04 1:26 PM, Paul Johnson wrote: > On Wed, May 12, 2004 at 12:59:44PM -0500, Ben Miller wrote: > >> my @links = $mech->find_all_links(tag = "a", text_regex => qr/\bWORD\b/i ); > > ... tag => "a", ... > > I suspect. Thank you to Paul and to Lee for their quick and efficient answer. That

Re: dependency tree

2004-05-12 Thread Andrew Gaffney
Jeff 'japhy' Pinyan wrote: On May 12, Andrew Gaffney said: my %tree = { package1 => [ package2, package3, package4 ], package2 => [ package7 ], package3 => [ package5 ], package4 => [ package7, package6], package5 => [ ], package6 => [ ]

dependency tree

2004-05-12 Thread Andrew Gaffney
In a program I'm working on, I build a hash "tree" of sorts that contains package dependencies. Each key contains an array with the first level dependencies of the key. Each one of those dependencies have their own key with their first level dependencies in the hash. For example: my %tree = { p

form based htaccess logins

2004-05-12 Thread jeffrey_n_Dyke
Hello. I'm looking for a script, and definitly willing to roll my own, that interacts with htaccess. It is quite simple to validate user input against the .htpasswd file and authenticate them into a given directory. But i need Apache to accept the user as a valid user, and not repompt with the b

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Andrew Gaffney wrote: Wiggins d Anconia wrote: Wiggins d Anconia wrote: my %masks; my %use; my @pkglist; my %pkgdeps; Why are these declared with a global scope? If they must be then something is wrong with your subs. Move these to after your sub listing, if your program still works then th

Re: DBD for SQL Server?

2004-05-12 Thread Kevin Old
On Tue, 2004-05-11 at 18:40, Richard Crawford wrote: > Is there a DBD for SQL Server so that I can connect to our SQL Server > 2000 database with DBI? I've hunted all over CPAN but I can't seem to > find one. Richard, I'm running a mod_perl site connected to a SQL Server 2000 backend via DBD::

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Wiggins d Anconia wrote: Wiggins d Anconia wrote: my %masks; my %use; my @pkglist; my %pkgdeps; Why are these declared with a global scope? If they must be then something is wrong with your subs. Move these to after your sub listing, if your program still works then they are fine as globals, ot

Re: DBD for SQL Server?

2004-05-12 Thread Richard Crawford
NYIMI Jose (BMB) wrote: -Original Message- From: Alok Bhatt [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 11:49 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: DBD for SQL Server? --- Richard Crawford <[EMAIL PROTECTED]> wrote: Is there a DBD for SQL Server so that

Re: return array/hash ref from function

2004-05-12 Thread Wiggins d Anconia
> Wiggins d Anconia wrote: > >> > >>my %masks; > >>my %use; > >>my @pkglist; > >>my %pkgdeps; > > > > Why are these declared with a global scope? If they must be then > > something is wrong with your subs. Move these to after your sub > > listing, if your program still works then they are fine

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Wiggins d Anconia wrote: Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I think that 'my' is bad because I have something similar to: : : my %tree; : : sub return_an_arrayref() { :my @array = ('thing1', 'thing2', 'thing3'); :return [EMAIL PROTECTED]; : } : : s

Re: return array/hash ref from function

2004-05-12 Thread Wiggins d Anconia
[snip] > > It was more pseudocode than anything. I can't seem to duplicate the problem with > test code. One thing I forgot to mention is that these functions are called > recursively as far as 15 levels deep. Would that cause issues when returning a > ref to a 'my'ed array from a function? >

Re: return array/hash ref from function

2004-05-12 Thread Wiggins d Anconia
> Charles K. Clarkson wrote: > > Andrew Gaffney <[EMAIL PROTECTED]> wrote: > > : > > : I think that 'my' is bad because I have something similar to: > > : > > : my %tree; > > : > > : sub return_an_arrayref() { > > :my @array = ('thing1', 'thing2', 'thing3'); > > :return [EMAIL PROTECTED]

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Wiggins d Anconia wrote: Wiggins d Anconia wrote: I have a number of functions in a program I'm writing that return a reference to an array or hash. In the functions, I declare the variable to return with 'my' which I'm finding out is bad. Should I declare variables to return from a functi

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I think that 'my' is bad because I have something similar to: : : my %tree; : : sub return_an_arrayref() { :my @array = ('thing1', 'thing2', 'thing3'); :return [EMAIL PROTECTED]; : } : : sub build_tree() { :for

RE: return array/hash ref from function

2004-05-12 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I think that 'my' is bad because I have something similar to: : : my %tree; : : sub return_an_arrayref() { :my @array = ('thing1', 'thing2', 'thing3'); :return [EMAIL PROTECTED]; : } : : sub build_tree() { :foreach(@thing) { : $tree

Re: return array/hash ref from function

2004-05-12 Thread Wiggins d Anconia
> Wiggins d Anconia wrote: > >>I have a number of functions in a program I'm writing that return a > > > > reference to > > > >>an array or hash. In the functions, I declare the variable to return > > > > with 'my' > > > >>which I'm finding out is bad. Should I declare variables to return fro

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Wiggins d Anconia wrote: I have a number of functions in a program I'm writing that return a reference to an array or hash. In the functions, I declare the variable to return with 'my' which I'm finding out is bad. Should I declare variables to return from a function with 'our'? Do I need to m

Re: return array/hash ref from function

2004-05-12 Thread Wiggins d Anconia
> I have a number of functions in a program I'm writing that return a reference to > an array or hash. In the functions, I declare the variable to return with 'my' > which I'm finding out is bad. Should I declare variables to return from a > function with 'our'? Do I need to make sure I don't ha

return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
I have a number of functions in a program I'm writing that return a reference to an array or hash. In the functions, I declare the variable to return with 'my' which I'm finding out is bad. Should I declare variables to return from a function with 'our'? Do I need to make sure I don't have confl

Text::KwikiFormatish on Win32 system

2004-05-12 Thread Hoenie Luk
Text::KwikiFormatish seems like a great module to format Wiki text into HTML. However, when I install it and run it on my Windows XP system, I got tons of "Unrecognized escape \p ..." errors. Then the output has a lot of extraneous anchored links where there should not be any. Does anybody kn

Re: Multi library

2004-05-12 Thread Wiggins d Anconia
Please bottom post > my openconf function contains: > > sub openconf { >my $pkg = shift; >my $self = bless([EMAIL PROTECTED],$pkg); >open(... > >return($self); > } > > I have "my @config;" set at the beggining of the module > As Lee pointed out it would be easier to

re: Win32::Process

2004-05-12 Thread William Black
I have the following code that starts two different processes/perl scripts. The code correctly calls and processes the perl scripts, but never seems to return back to the calling script for further processing. Does anyone have any clue why this might happen? #Create dal process if ($OK == 0)

Re: Multi library

2004-05-12 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: my openconf function contains: sub openconf { my $pkg = shift; my $self = bless([EMAIL PROTECTED],$pkg); open(... I don;'t think open(... will work :) Wy not share the whole code and also param() or how can we help :) return($self); } Lee.M

Re: WWW::Mechanize question

2004-05-12 Thread JupiterHost.Net
Ben Miller wrote: Hi, Hello, I'm reading/scraping hyperlinks from a specific web page using the following while incorporating the WWW::Mechanize module: my @links = $mech->find_all_links(tag = "a", text_regex => qr/\bWORD\b/i ); try tag => 'a' you are trying to assign a value of a to tag the wa

WWW::Mechanize question

2004-05-12 Thread Ben Miller
Hi, I'm reading/scraping hyperlinks from a specific web page using the following while incorporating the WWW::Mechanize module: my @links = $mech->find_all_links(tag = "a", text_regex => qr/\bWORD\b/i ); When I run the program, I get an error: 'Can't modify constant item in scalar assignment at

GD module and LD_LIBRARY_PATH problem

2004-05-12 Thread Halkyard, Jim
Hi all, I have a problem with the GD module on Solaris 5.8 using Perl 5.6.1. I have installed Perl to /usr/local/bin/perl and /usr/app/perl is a symlink to fit in with certain conventions round here. When compiling the GD module it asked me where libgd was installed, and I told it - /usr/loca

Re: Multi library

2004-05-12 Thread max4o
my openconf function contains: sub openconf { my $pkg = shift; my $self = bless([EMAIL PROTECTED],$pkg); open(... return($self); } I have "my @config;" set at the beggining of the module - This mail is from: <[EMAIL PROTECTED]>

Re: Multi library

2004-05-12 Thread Wiggins d Anconia
> Hi, > I'm trying to create library that can open many config files. For > examlpe, I have cfg1.conf and cfg2.conf. My lib is getting information > from those files and store it into an array. If I do: > > my $cfg1 = My::Lib->openconf("cfg1.conf"); > my $cfg2 = My::Lib->openconf("cfg2.conf"); >

Re: Net::Telnet executing commands on remote shell after executing su

2004-05-12 Thread Wiggins d Anconia
> Hi, > > I am using Net::Telnet and getting a new shell on a remote machine > all my commands work fine > Now suppose I become root using "su" and "pass" I am not able to > execute commands on this root shell > Can anyone show me How I can do this > I believe you are going to need to use th

Multi library

2004-05-12 Thread max4o
Hi, I'm trying to create library that can open many config files. For examlpe, I have cfg1.conf and cfg2.conf. My lib is getting information from those files and store it into an array. If I do: my $cfg1 = My::Lib->openconf("cfg1.conf"); my $cfg2 = My::Lib->openconf("cfg2.conf"); print $cfg1->par

RE: DBD for SQL Server?

2004-05-12 Thread NYIMI Jose (BMB)
> -Original Message- > From: Alok Bhatt [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 12, 2004 11:49 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: DBD for SQL Server? > > > > --- Richard Crawford <[EMAIL PROTECTED]> > wrote: > > Is there a DBD for SQL Server so that

Re: DBD for SQL Server?

2004-05-12 Thread Alok Bhatt
--- Richard Crawford <[EMAIL PROTECTED]> wrote: > Is there a DBD for SQL Server so that I can connect > to our SQL Server > 2000 database with DBI? I've hunted all over CPAN > but I can't seem to > find one. Windows uses the Open Database Connectivity (ODBC) Model. You can connect to an MS-SQL

Re: File Find

2004-05-12 Thread Ramprasad A Padmanabhan
On Wed, 2004-05-12 at 02:18, Joseph Ruffino wrote: > Hi, > > I have a question that maybe someone can help me with. I am > writing/creating a file on a unix server, and I check to see if the file > exists before I create it. If it does create a new file, I want to send > the previous file via

Re: Symbolic references

2004-05-12 Thread Rob Dixon
Jan Eden wrote: > > Hi all, > > there must be a better way to do this. My task is to create a multiple choice > test in HTML. First, I print the question (frage): > > my $query = "SELECT frage_id, frage_text, antwort_text_1, antwort_text_2, > antwort_text_3, antwort_text_4, ant

RE: DBD for SQL Server?

2004-05-12 Thread NYIMI Jose (BMB)
> -Original Message- > From: Richard Crawford [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 12, 2004 12:40 AM > To: [EMAIL PROTECTED] > Subject: DBD for SQL Server? > > > Is there a DBD for SQL Server so that I can connect to our SQL Server > 2000 database with DBI? I've hunted all

File Find

2004-05-12 Thread Joseph Ruffino
Hi, I have a question that maybe someone can help me with. I am writing/creating a file on a unix server, and I check to see if the file exists before I create it. If it does create a new file, I want to send the previous file via e-mail to a specific person. I currently have it working for

Weird SMTP filtering/blocking problem

2004-05-12 Thread David Garamond
I run a homegrown SMTP daemon written in Perl, on Redhat 7.3. Lately, emails sent from some clients are received in duplicates. The clients either run Communigate Pro, or IPlanet, MDaemon, all running some versions of Windows. The emails duplicate because the client sends it multiple times. The ca