RE: Regex c code

2005-02-23 Thread Brandon Willis
As far as I can see you aren't missing anything. perl -e '$a=foo [ 0 ] = function(1,2,3,4); $a=~/(\w+)\(/; print $1' works great for me. =) But you might think about using this: perl -e '$a= foo [ 0 ] = function (1,2,3,4); $a=~/\b(\w+)\b\s*?\(/; print $1' The zero width assertion \b and the

RE: Regex c code

2005-02-23 Thread Brandon Willis
Very strange... What platform and perl are you on? I'm on RH7.3 perl 5.6.1. And could you try this: my $a= foo [ 0 ] = function(a,b,v,t); $a=~/\b(\w+)\b\s*?\(/; print \$` =|$`|\n\$ =|$|\n\$' =|$'|\n\$1 =|$1|\n; __END__ My output is this: $` =| foo [ 0 ] = | $ =|function(| $' =|a,b,v,t)| $1

Re: how to handle multiline feedback from backticksoperator?

2005-02-23 Thread John W. Krahn
Bastian Angerstein wrote: Hello there, Hello, I have a cmd-PRogramm which produce multiline output. /usr/testdrive. I call this proggi from perl: `/usr/testdrive -e -k | grep /home`; This programm produce multiline Output, how do I get this into a variable my $variable = `/usr/testdrive -e -k |

printing output of ping command

2005-02-23 Thread TapasranjanMohapatra
Hi All, I have a script as follows my $host = shift; my $count = shift; my $result = `ping -c $count $host`; if($result =~ m/$count packets transmitted, $count packets received/) { $success = 1; } print $result\n; Now, when I run the

Re: printing output of ping command

2005-02-23 Thread radhika
This works: #!/usr/bin/perl use strict; use diagnostics; my $host = www.netbsd.org; my $count = 0; system(ping -c 5 $host); = thx, Radhika Hi All, I have a script as follows my $host = shift; my $count = shift; my $result = `ping -c $count $host`;

Re: printing output of ping command

2005-02-23 Thread Ankur Gupta
TapasranjanMohapatra wrote: Hi All, I have a script as follows my $host = shift; my $count = shift; my $result = `ping -c $count $host`; if($result =~ m/$count packets transmitted, $count packets received/) { $success = 1; } print $result\n;

RE: Using the perl debugger with options

2005-02-23 Thread Tyson Sommer
-Original Message- From: radhika [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 12:37 PM To: beginners@perl.org Subject: Using the perl debugger with options Hi, I am a beginner perl programmer (but not exactly a novice) and am writing a perl module which is

RE: Using the perl debugger with options

2005-02-23 Thread radhika
Did you try: perl -d /path/to/my_perl_script --install --dbname=blah That works for me on my scripts with Getopt::Long Hi, I did try: perl -d ./my_script --install --dbname=bbb That did not seem to work for me. It could be that certain modules I am writing are not loading properly.

Re: printing output of ping command

2005-02-23 Thread Chris Devers
On Wed, 23 Feb 2005, TapasranjanMohapatra wrote: I have a script as follows my $host = shift; my $count = shift; my $result = `ping -c $count $host`; if($result =~ m/$count packets transmitted, $count packets received/) { $success = 1; } print $result\n;

problem in downoading file using get( ) of POP3

2005-02-23 Thread girish kelwalkar
  hello experts, I am writing one code which detect new coming mails from server and download it to file. I am showing you the portion of code. 1 for($l=1;$l=$msg_id;$l++) 2 { 3 my $MsgContent = $pop3-top($l, 20); 4 open (CHECK, msgtext$l.txt) || die

Re: problem in downoading file using get( ) of POP3

2005-02-23 Thread Wiggins d'Anconia
girish kelwalkar wrote: hello experts, I am writing one code which detect new coming mails from server and download it to file. I am showing you the portion of code. 1 for($l=1;$l=$msg_id;$l++) 2 { 3 my $MsgContent = $pop3-top($l, 20); 4 open

printing output of ping command -- New question at bottom.

2005-02-23 Thread Tyson Sommer
-Original Message- From: Chris Devers [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 23, 2005 10:14 AM To: TapasranjanMohapatra Cc: Perl Beginners List Subject: Re: printing output of ping command On Wed, 23 Feb 2005, TapasranjanMohapatra wrote: I have a script as

Re: printing output of ping command -- New question at bottom.

2005-02-23 Thread Chris Devers
On Wed, 23 Feb 2005, Tyson Sommer wrote: This might be a question for beginners-cgi, but since it was mentioned here... Sounds like it, but oh well. This doesn't really fix your problem so much as your error handling, but why aren't you catching the reason your script dies? Instead of

Read from a Linux pipe hangs.

2005-02-23 Thread David Moron
Hi everybody, I'm testing a simple IPC implementation that uses Linux pipes to communicate a producer script and a consumer. The producer script looks like: while(1){ print Hello\n; sleep(2); } And the consumer: my @lines; while(1){ sleep(10); if

PerlMagick working trouble

2005-02-23 Thread Nicolay Vasiliev
Hello, there! I use PerlMagick (PM) in my work. So, I try to check is the downloaded graphical file correct. I thought using some of PM methods (Ping ie) could help me but no. I tried to run the script in shell and I get the message 'html2ps not found...'. If the file is correct all is OK. eval

RE: Read from a Linux pipe hangs.

2005-02-23 Thread Bob Showalter
David Moron wrote: Hi everybody, I'm testing a simple IPC implementation that uses Linux pipes to communicate a producer script and a consumer. The producer script looks like: while(1){ print Hello\n; sleep(2); } And the consumer: my @lines; while(1){

Re: Read from a Linux pipe hangs.

2005-02-23 Thread David Moron
The consumer has only to read lines from its STDIN and print them to the STDOUT. These scripts are a simplified version of the producer/consumer problem and they try to emulate a multithreaded perl program. IMHO It's not important what I want to do with consumer, the problem is that consumer

RE: Read from a Linux pipe hangs.

2005-02-23 Thread Bob Showalter
David Moron wrote: The consumer has only to read lines from its STDIN and print them to the STDOUT. print while(); These scripts are a simplified version of the producer/consumer problem and they try to emulate a multithreaded perl program. IMHO It's not important what I want to do with

Re: Read from a Linux pipe hangs.

2005-02-23 Thread David Moron
I need the read non-blocking of check if there's any data ready before doing the READ. The complete consumer is a program that reads account packets from a radius server (this problem has been solved) and stores the Radius attributes (MAC,IP,User_name) in a List of Hashes. This list of hashes has

Re: printing output of ping command -- New question at bottom.

2005-02-23 Thread John W. Krahn
Tyson Sommer wrote: This might be a question for beginners-cgi, but since it was mentioned here... I tried to use Net::Ping in a CGI script and it said I didn't have permissions to run ping. I can execute the section of the CGI script with the call to Net::Ping just fine from the cmd line as a

Re: [Maybe OT] . . .the Contracting Business

2005-02-23 Thread Todd W
Ron Wingfield [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] snip / Always contract for 1099 payment -- Never, never W2! Can I ask why? I landed some telecommuting work I've been doing for about a month now and the proprietor wants to move me to a W2... Thanks, Todd -- To

Use of uninitialized value in pattern match ..., chunk 2

2005-02-23 Thread mark McWilliams
What is the following telling me , especially the chunk 2? Use of uninitialized value in pattern match (m//) at ./lo line 27, chunk 2 I used if (defined ... to get rid of a few other errors. this is in reference to the following code edited to reduce size while (defined($in = )) { if (

Re: [Maybe OT] . . .the Contracting Business

2005-02-23 Thread Ron Wingfield
Hi Todd, . . .Because anyone working as a W2 employee is NOT a contractor! A W2 employee is just that, an employee. Among other things, the IRS can look (as in an audit) at any W2 work performed in the past or future, if it is similar to or otherwise intertwined with other 1099 services that

Upgrading from Perl 5.6 to Perl 5.8

2005-02-23 Thread Paul Ohashi
Hi all, I've upgraded to Perl 5.8 from 5.6 and I'm getting output I don't understand when I try to install the DBI module. I'm on Solaris 9 (Sparc) and I had Perl 5.0 and 5.6 installed as packages and I removed them with pkgrm. I then installed Perl 5.8 from ActiveState using

Re: Upgrading from Perl 5.6 to Perl 5.8

2005-02-23 Thread Chris Devers
On Wed, 23 Feb 2005, Paul Ohashi wrote: I've upgraded to Perl 5.8 from 5.6 and I'm getting output I don't understand when I try to install the DBI module. I'm on Solaris 9 (Sparc) and I had Perl 5.0 and 5.6 installed as packages and I removed them with pkgrm. I then installed Perl 5.8

Re: Upgrading from Perl 5.6 to Perl 5.8

2005-02-23 Thread Eduardo Vázquez Rodríguez
Where did you install perl? Does your environment variables are pointing to the new perl version?. I had the same error and I fixed changing the usual path /usr/bin/perl to the new one /usr/local/bin/perl, just use the ln command As long as I remember the newer versions of perl are installed

Re: [Maybe OT] . . .the Contracting Business

2005-02-23 Thread Kurt Cagle
James, If I can add my two cents worth here as well ... I have similarly been contracting for about twenty five years, and I will second everything that Ron wrote. Incorporate as an s-chapter corporation - if you go in as a sole proprieter, you're personally liable for all debts incurred,

Constantly refreshing clock using Curses::UI?

2005-02-23 Thread Callan Tham
Hello list! I am struggling with a particular problem using Curses::UI. I am trying to display a constantly refreshing clock in the curses interface without much success. I've tried using a while loop instead of the mainloop() provided by Curses::UI, and still no effect. Here's a snippet of my

Re: Use of uninitialized value in pattern match ..., chunk 2

2005-02-23 Thread John W. Krahn
mark McWilliams wrote: What is the following telling me , especially the chunk 2? Use of uninitialized value in pattern match (m//) at ./lo line 27, chunk 2 That means that the variable that is bound to the pattern match contains the value undef. chunk 2 means that you are currently reading the

Including one perl script in another

2005-02-23 Thread [EMAIL PROTECTED]
Greetings How do I include a script in another one? For instance. I have a script called myscript.pl and I have a second one called config.pl. config.pl contains perl code as well, but more like only declarations and stuff. How do I now take that and include it in myscript.pl. Best regards KK

RE: Upgrading from Perl 5.6 to Perl 5.8

2005-02-23 Thread Thomas Bätzler
Paul Ohashi [EMAIL PROTECTED] asked: Now I'm trying to install the DBI module and when I execute 'perl Makefile.PL' the output returned says: I see you're using perl 5.008006 on sun4-solaris, okay. There's nothing in my environment that says perl 5.0. My question is two fold: