Re: Executing commands through Perl

2007-07-17 Thread Matthew Topper
-- Forwarded message -- From: Matthew Topper <[EMAIL PROTECTED]> Date: Jul 17, 2007 6:17 AM Subject: Re: Executing commands through Perl To: Teresa Thomas <[EMAIL PROTECTED]> It sounds like Perl might be overkill for this. Personally, anytime I find myself using the system call a

Re: Parsing HTML (Table)

2007-07-17 Thread Rob Dixon
yitzle wrote: I'm using WWW::Mechanize to retrieve a web page. I get to this line: my $page = $mech->response()->decoded_content(); The page got a with values I wish to extract. What module is best suited to getting to that data? I'm hoping for a somewhat simple to use module. WWW::Mechani

Re: Fork()ing and CGI?

2007-07-17 Thread Ken Foskey
On Tue, 2007-07-17 at 00:44 -0400, yitzle wrote: > I need some guidance... > I'm thinking of writing a CGI script that someone can pass some data > and set it running. The script may take a few seconds to run. > Is it safe/correct/OK to have a CGI script fork, with one thread > respondng with a HTT

Re: Fork()ing and CGI?

2007-07-17 Thread Tom Phoenix
On 7/16/07, yitzle <[EMAIL PROTECTED]> wrote: I'm thinking of writing a CGI script that someone can pass some data and set it running. The script may take a few seconds to run. Is it safe/correct/OK to have a CGI script fork, with one thread respondng with a HTTP response while the other thread

beginners@perl.org

2007-07-17 Thread Rob Dixon
yitzle wrote: I know this isn't the best way to parse it, but I need to check the $ENV{'QUERY_STRING} for some values. I originally had =~ /^limit=([0-9]{1,3})$/ which worked. But I tried to replace the ^ with [&^] and the $ with [&$] to allow the string to be part of a longer string at

Re: Fork()ing and CGI?

2007-07-17 Thread yitzle
Thanks for the replies! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Executing commands through Perl

2007-07-17 Thread Teresa Thomas
Perl's system() function seems to be working great for simple commands like 'pwd' , 'ls' that does not require user interaction. But when I try to execute commands that require user input (eg, su or yum while not on root), then it says 'standard in must be a tty' and fails. Is this because Pe

connect a database in remote server (can connect to the server via SSH)

2007-07-17 Thread zhangxiaoyu912
Hi, All: I am a new to perl. My perl code need to connect to the database in the remote server, and I can login that server via SSH. Can anyone give me a hint about how can I do that? Many thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] htt

Re: Executing commands through Perl

2007-07-17 Thread Mr. Shawn H. Corey
Teresa Thomas wrote: Perl's system() function seems to be working great for simple commands like 'pwd' , 'ls' that does not require user interaction. But when I try to execute commands that require user input (eg, su or yum while not on root), then it says 'standard in must be a tty' and fails

Re: connect a database in remote server (can connect to the server via SSH)

2007-07-17 Thread Tom Phoenix
On 7/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I am a new to perl. My perl code need to connect to the database in the remote server, and I can login that server via SSH. Can anyone give me a hint about how can I do that? Many thanks. Have you seen what's on CPAN? http://search.c

Re: Executing commands through Perl

2007-07-17 Thread Tom Phoenix
On 7/17/07, Teresa Thomas <[EMAIL PROTECTED]> wrote: But when I try to execute commands that require user input (eg, su or yum while not on root), then it says 'standard in must be a tty' and fails. These are programs that don't expect to be run by other programs, but by humans. If you want to

Re: connect a database in remote server (can connect to the server via SSH)

2007-07-17 Thread Francisco Valladolid
Hi. You must check if the Database ports are open, if no ask to the admin. Regards On 7/17/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 7/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am a new to perl. My perl code need to connect to the database in > the remote server, and I can

Re: Executing commands through Perl

2007-07-17 Thread John W. Krahn
Teresa Thomas wrote: Perl's system() function seems to be working great for simple commands like 'pwd' , 'ls' that does not require user interaction. But when I try to execute commands that require user input (eg, su or yum while not on root), then it says 'standard in must be a tty' and fails

Re: connect a database in remote server (can connect to the server via SSH)

2007-07-17 Thread Jeff Pang
--- [EMAIL PROTECTED] wrote: > Hi, All: > I am a new to perl. My perl code need to connect to > the database in > the remote server, and I can login that server via > SSH. Can anyone > give me a hint about how can I do that? Many thanks. > You may use perl's database operation module DBI.pm,if

Re: connect a database in remote server (can connect to the server via SSH)

2007-07-17 Thread Chas Owens
On 7/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, All: I am a new to perl. My perl code need to connect to the database in the remote server, and I can login that server via SSH. Can anyone give me a hint about how can I do that? Many thanks. To answer accurately we need some more in

Re: Executing commands through Perl

2007-07-17 Thread Jeff Pang
--- "Mr. Shawn H. Corey" <[EMAIL PROTECTED]> wrote: > You can't run su except from a terminal. This is > not part of Perl, it's > part of the security for su. There's no way > around this. > No way?I think Expect.pm can do this.Though putting passwords, especially root passwords, into scrip

HoH efficiency

2007-07-17 Thread Rodrick Brown
Is there a more efficient way to handle the method I choose to unroll my HoH. Thanks. #!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; my @data = ; my ($user,$gid,$homedir,%userMap); foreach(@data) { /^#/ and next; /(\w+):/ and $user = $1; /\w+:*:(\d+):/ and $gid = $1; /.*:(.*

Writing a Program

2007-07-17 Thread CJ
To all you who know: I'm trying to write a program, granted it's going to be a large one, that will keep track of people's computers when they're in my shop being repaired. I want to assign a number to each computer system, and that number will stay with that machine throughout the program. I wa

Re: Writing a Program

2007-07-17 Thread yitzle
I'm not the most qualified to answer this question, but if all you want is a simple menu driven interface for a MySQL DB, Perl should be an easy way to accomplish it. Using a graphical module you should also be able to make a nice GUI. If you are going to go ahead, you want to first learn the bas

Q: cannot use 'use base' without quote ?

2007-07-17 Thread Jack Minoshima
Hi! Nice to see you. I'm new to OOP Peal. Let me ask you a silly question. When I try to use 'use base', I encountered an problem. I wrote this program; --- Animal.pm package Animal; sub speak { my $class = shift; print "a $class goes "

Q: cannot use base while Exporting ?

2007-07-17 Thread Jack Minoshima
Hi. Please allow me to ask another silly question. I wrote the program and it works fine. Animal.pm package Animal; use Exporter; @ISA = qw(Exporter); @EXPORT = qw(speak); sub speak { print "I speak!\n"; } 1; -

Re: HoH efficiency

2007-07-17 Thread Jeff Pang
--- Rodrick Brown <[EMAIL PROTECTED]> wrote: > Is there a more efficient way to handle the method I > choose to unroll my HoH. > Thanks. > > #!/usr/bin/perl -w > use strict; > use warnings; > use Data::Dumper; > > my @data = ; > > my ($user,$gid,$homedir,%userMap); > foreach(@data) { > /^#/

Re: Q: cannot use 'use base' without quote ?

2007-07-17 Thread Jack Minoshima
I forgot to describe my environment. it's here. C:\Documents and Settings\jackm\usetest>perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 50 registered patches, see perl -V for more detail) Copyright 1987-2006, Larry Wall Binary build 820 [274739] provided by ActiveState h

Re: Writing a Program

2007-07-17 Thread Daniel Kasak
On Wed, 2007-07-18 at 03:56 +, CJ wrote: > To all you who know: > > I'm trying to write a program, granted it's going to be a large one, > that will keep track of people's computers when they're in my shop > being repaired. I want to assign a number to each computer system, > and that number