Re: File::find with no_chdir

2006-09-19 Thread Beginner
On 18 Sep 2006 at 22:34, John W. Krahn wrote: I see. Thanx And this I guess: Ternary ``?:'' is the conditional operator, just as in C. It works much like an if-then-else. If the argument before the ? is true, the argument before the : is returned, otherwise the argument after the : is

Re: File::find with no_chdir

2006-09-19 Thread Emilio Casbas
John W. Krahn wrote: Emilio Casbas wrote: Hi, Hello, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a

Re: File::find with no_chdir

2006-09-19 Thread Mumia W.
On 09/18/2006 10:11 AM, Emilio Casbas wrote: Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search,

[perl #40345] splice question

2006-09-19 Thread Tova Yaron
Hello, Trying to remove from array blank lines, its look like splice get confuse with the array size after removing the blank entry. Or maybe I'm getting confuse.. Thanks Dov use strict; my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8, $str9,) =

RE: [perl #40345] splice question

2006-09-19 Thread Thomas Bätzler
Tova Yaron [EMAIL PROTECTED] wrote: Trying to remove from array blank lines, its look like splice get confuse with the array size after removing the blank entry. Or maybe I'm getting confuse.. my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8, $str9,) =

overcome ping requires root privilege when running as a cgi script

2006-09-19 Thread ubergoonz
Hi, I wonder if anyone have a solution to the subject problem when using Net::Ping ? -- Best Regards, ubergoonz

Re: [perl #40345] splice question

2006-09-19 Thread Dr.Ruud
Tova Yaron schreef: Trying to remove from array blank lines, its look like splice get confuse with the array size after removing the blank entry. Or maybe I'm getting confuse.. When an element is removed, your loop-variable is no longer in sync. Consider grep: #!/usr/bin/perl use

Re: [perl #40345] splice question

2006-09-19 Thread John W. Krahn
Tova Yaron wrote: Hello, Hello, Trying to remove from array blank lines, its look like splice get confuse with the array size after removing the blank entry. Or maybe I'm getting confuse.. use strict; my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8,

Re: [perl #40345] splice question

2006-09-19 Thread John W. Krahn
Thomas Bätzler wrote: One possibility that would work is to use $ref_array = [ grep /^.+$/, @$ref_array ]; It would be more efficient to use the regex /./s or the length function. Your regex has to match ALL the characters. (And it won't match if there are multiple lines in the string.)

RE: transition to Perl developer

2006-09-19 Thread Derek B. Smith
--- Lee Goddard [EMAIL PROTECTED] wrote: Most of the docs you'll ever need are in perldoc Perldoc perl Perldoc perltoc Table of contents perlbootPerl OO tutorial for beginners perltootPerl OO tutorial, part 1 perltooc

RE: transition to Perl developer

2006-09-19 Thread Derek B. Smith
--- Lee Goddard [EMAIL PROTECTED] wrote: --- Derek B. Smith [mailto:[EMAIL PROTECTED] wrote: --- Lee Goddard [EMAIL PROTECTED] wrote: Most of the docs you'll ever need are in perldoc Perldoc perl Perldoc perltoc Table of contents perlboot

STDOUT

2006-09-19 Thread hOURS
Hi all, I've written a PERL program that runs other PERL programs (through 'require' statements and what not). It worked fine for a couple tasks I had in mind, but there's an obstacle ahead in the next thing I want to use it for. The programs it will execute may (or may not)

Re: STDOUT

2006-09-19 Thread Tom Phoenix
On 9/19/06, hOURS [EMAIL PROTECTED] wrote: Asking it to 'require' a program with a syntax error will cause the main program to quit and print out the appropriate error message for that. I don't want that. I want it to keep going. You probably want 'eval', but also check out the

Re: STDOUT

2006-09-19 Thread John W. Krahn
hOURS wrote: Hi all, Hello, So, many thanks in advance to anyone who can tell me how to use STDOUT for this. Or if you have another way to read that message before the program quits, or another way to test for syntax errors... that's cool too. perldoc -f do John -- use Perl; program

Re: STDOUT

2006-09-19 Thread Travis Thornhill
Would something like this (with backticks) work? It's probably not as robust as using 'do BLOCK' but it might work. #untested my $progname = whatever.pl; my $output = `perl -c $progname`; if ( $output =~ /$progname syntax OK/ ) { # It's good } else { # It's bad }

Re: STDOUT

2006-09-19 Thread Travis Thornhill
Actually if the syntax is good the output will contain one line. If there are errors there will be multiple lines. This would work better: my $progname = whatever.pl; my @output = `perl -c $progname`; my $syntax_ok = 0; foreach my $line ( @output ) { if ( $line =~ /$progname

RE: [perl #40345] splice question

2006-09-19 Thread Derek B. Smith
And why would this be? Becasue it does not load the entire data set at once or aka one at a time? If you really need to do this in place due to memory constraints, I would advise to run the iteration from back to front, i.e. foreach my $indx (reverse 0..$#$ref_array)

Re: STDOUT

2006-09-19 Thread hOURS
Thanks Travis, I'll give your code a shot, but every time I use backticks my computer crashes. Thanks to John and Tom for suggesting do and eval. I read up on those. I don't understand them entirely, but I experimented. They seem to accomplish about the same thing. I wrote two one-line

Re: transition to Perl developer

2006-09-19 Thread JupiterHost.Net
Derek B. Smith wrote: Is there a Perl open source project currently underway wherein anyone can contribute by writing code for the projects completion such as Jbilling? Jbilling is an Derek, reread that. That question makes no sense, do you mean CPAN? Do you mean something that does what

Re: transition to Perl developer

2006-09-19 Thread Derek B. Smith
--- JupiterHost.Net [EMAIL PROTECTED] wrote: Derek B. Smith wrote: Is there a Perl open source project currently underway wherein anyone can contribute by writing code for the projects completion such as Jbilling? Jbilling is an Derek, reread that. That question makes no sense,

Newbie Question

2006-09-19 Thread M K Scott
Hi all, Please forgive the newbie nature of this question but i'm just starting off teaching myself perl from scratch and so need a little clarification. I am trying to put together a script to do pattern matching and while I can get the basic syntax alright it doesn't seem to be working as

Re: Newbie Question

2006-09-19 Thread Igor Sutton
while ($string != m/[a-zA-Z]{1,5}/ ) { print(that is wrongtry again: ); chomp ($string = STDIN); } Maybe: while ($string !~ m/.../) { ... } When you're matching against regular expressions, you need to use =~ or !~. Hope this helps. -- Igor Sutton Lopes t: +55 51

Re: transition to Perl developer

2006-09-19 Thread JupiterHost.Net
Derek B. Smith wrote: OK CPAN yes I know it is an open source project, but are there task assignments for specific tasks/projects as opposed to submitting a module? So you are looking for an open source project done in Perl that has a community todo list that you can contribute to or an

Re: Newbie Question

2006-09-19 Thread John W. Krahn
M K Scott wrote: Hi all, Hello, Please forgive the newbie nature of this question but i'm just starting off teaching myself perl from scratch and so need a little clarification. I am trying to put together a script to do pattern matching and while I can get the basic syntax alright it

Re: STDOUT

2006-09-19 Thread John W. Krahn
hOURS wrote: Thanks to John and Tom for suggesting do and eval. I read up on those. I don't understand them entirely, but I experimented. They seem to accomplish about the same thing. I wrote two one-line programs:print eval(system('perl -c nextprogramtoexecute.pl')); and print