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
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
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,
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,)
=
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,)
=
Hi,
I wonder if anyone have a solution to the subject problem when using
Net::Ping ?
--
Best Regards,
ubergoonz
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
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,
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.)
--- 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
--- 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
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)
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
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
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
}
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
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)
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
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
--- 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,
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
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
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
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
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
25 matches
Mail list logo