Hi All
I am a perl newbie.
I have a small perl script that is actually a cgi-bin script. I am told that
until a recent server change over it ran fine however now it produces no output.
I have tried running it from a command line and redirecting the input it would
have received as a cgi-bin script
> I'd like to know how many characters there are between the first and the
>last "yes". The way I now come up with to do this is to use substitution to
>"mark" the first and the last match, then use a counting loop to calculate
>the characters..rather straightforward and stupid method.
I t
- Original Message -
From: ""zhihua li"" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To:
Sent: Monday, October 23, 2006 9:05 PM
Subject: count the characters between the matches
hi netters,
I'm curious if there's any smart code to calculate the "distance" between
the matches in
zhihua li wrote:
> hi netters,
Hello,
> I'm curious if there's any smart code to calculate the "distance"
> between the matches in a text.
> Suppose I have a text like this:
> syhk...yes...uhg;ka=...yes...yiealg.yes...ghe;a...yes...
> Apparently it has multiple words of "yes". I'd like t
How about this .
$str = 'syhk...yes...uhg;ka=...yes...yiealg.yes...ghe;a...yes...';
$count = $str;
$count = $count =~ s/yes//g;
print "$count\n"
-Original Message-
From: zhihua li [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 24, 2006 10:05 AM
To: beginners@perl.org
Subject: c
hi netters,
I'm curious if there's any smart code to calculate the "distance" between
the matches in a text.
Suppose I have a text like this:
syhk...yes...uhg;ka=...yes...yiealg.yes...ghe;a...yes...
Apparently it has multiple words of "yes".
I'd like to know how many characters there
From: "Oleg V. Volkov" <[EMAIL PROTECTED]>
> "Dr.Ruud" <[EMAIL PROTECTED]> wrote:
> > Provide code, so we can guess better.
>
> Here's example how I use it in functions:
>
> sub add_service{
> our($login, $type_id, $account_id, $ap_id, $rule);
Please DON'T!
You DO want to use
my ($log
On 10/23/06, Michael Gale <[EMAIL PROTECTED]> wrote:
Is there a way that perl can load a module as root ? or somehow sudo
with in it self to use the module ?
Not like you're thinking. Sorry.
One way around the problem is to make a privileged daemon which can
update the tables (or whatever is
In the C language what the debate is about is clearly: UNDEFINED.
Java works deliberately DIFFERENTLY, it enforces a predictable sequence.
I think in Perl, the outcome is also UNDEFINED (as Mr. Jay already said).
I presume the Perl language acts here just as C. It is pointless to
argue about or
Hello,
I have a perl module that updates iptables using the IPTables::IPv4
module.
Now currently we have a service that runs as a non-root user and we
would like to plug our perl module into this service so the server can
change iptable rules.
However to use the IPTables::IPv4 module I be
Jay Savage wrote:
> On 10/20/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
>> Paul Johnson wrote:
>> >
>> > On Fri, Oct 20, 2006 at 10:56:09AM +0200, Dr.Ruud wrote:
>> >
>> >> Norbert Preining schreef:
>> >>>
>> >>> Dr.Ruud:
>>
>> $ perl -wle '
>> $a = 3;
>> $b = 0 + (++$a) +
Hello list,
I have a question on compilation problems for Date::Calc on a 64 bit
RHEL machine.
When I use cpan to install Date::Calc and Bit::Vector I get the
following problem :
gcc -shared Calc.o DateCalc.o -o blib/arch/auto/Date/Calc/Calc.so
/usr/bin/ld: skipping incompatible
/usr/lib/
... in the meantime, I discovered a solution, so let me answer
my own question in case somebody else stumbles on this.
Peter Daum wrote:
> I am trying to figure out a way to write data to a fifo without
> knowing whether there is a reader available and without ever blocking.
> What I'd like is som
On 10/23/06, Adriano Ferreira <[EMAIL PROTECTED]> wrote:
On 10/23/06, Romeo Theriault <[EMAIL PROTECTED]> wrote:
> Thank you Adriano, that works nicely after I added:
>
> use Memoize::AnyDBM_File;
>
> before that I was getting this error:
>
> AnyDBM_File doesn't define an EXISTS method at
I
On 10/20/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
Paul Johnson wrote:
>
> On Fri, Oct 20, 2006 at 10:56:09AM +0200, Dr.Ruud wrote:
>
>> Norbert Preining schreef:
>>>
>>> Dr.Ruud:
$ perl -wle '
$a = 3;
$b = 0 + (++$a) + ($a++);
print "b=$b\n";
'
b=8
On 10/23/06, Romeo Theriault <[EMAIL PROTECTED]> wrote:
Thank you Adriano, that works nicely after I added:
use Memoize::AnyDBM_File;
before that I was getting this error:
AnyDBM_File doesn't define an EXISTS method at
I had not payed much attention to the fact that your code were using
On Oct 23, 2006, at 8:45 AM, Adriano Ferreira wrote:
On 10/23/06, Romeo Theriault <[EMAIL PROTECTED]> wrote:
This all works fine, but in
the last step of the program I am trying to get the program to tell
me key's that are unique to only the first hash. No matter what I do
it always prints out
-- Forwarded message --
From: Anshul Saxena <[EMAIL PROTECTED]>
Date: Oct 23, 2006 8:38 AM
Subject: Re: reg expression again
To: chen li <[EMAIL PROTECTED]>
You should try :
my $file_name =~ /^(OT).*(\d+$)/
The caret ^ when outside any brackets, indicates that the character you a
On 10/23/06, Peter Daum <[EMAIL PROTECTED]> wrote:
I am trying to figure out a way to write data to a fifo without
knowing whether there is a reader available and without ever blocking.
Although you could use the four-arg select() to detect ready-to-write,
there's no way to avoid filling the b
>Unfortunately, the open fails unless there is somebody reading from
>the fifo- It is possible to open a fifo for read without blocking, but
>I couldn't find any way to do this for writing. For reading, it also
>seems to be possible to ge a signal if data is available, but I can't
>think of any wa
xavier mas wrote:
to assing values to a (key of ) hash do as: $hash_name{$key_name} =
$value_name. to read same pair key/value use each function into a while loop:
while (($key_name, $value_name)) = each %hash_name). sign % indicates the
whole hash.
Thanks for the help, I"m sorry if I'm a
On 10/23/06, Romeo Theriault <[EMAIL PROTECTED]> wrote:
This all works fine, but in
the last step of the program I am trying to get the program to tell
me key's that are unique to only the first hash. No matter what I do
it always prints out all of the values in the first hash, not the
keys that
"Dr.Ruud" <[EMAIL PROTECTED]> wrote:
> Provide code, so we can guess better.
Here's example how I use it in functions:
sub add_service{
our($login, $type_id, $account_id, $ap_id, $rule);
# Here we do some universal sanity checks for all add_* functions
attr({ croak_wrong_args(@_) });
print "A
Hi, I'm playing with hashes trying to get myself more familiar with
them. I have a little program below that has a hash with some keys
and values in it. The program then copies some of the values/keys to
another hash depending on their values. This all works fine, but in
the last step of th
Sorry, this probably really is more a general unix/linux problem than
a perl issue but I couldn't find any more suitable place to ask:
I am trying to figure out a way to write data to a fifo without
knowing whether there is a reader available and without ever blocking.
What I'd like is somthing li
[EMAIL PROTECTED] writes:
>> It showed that there is a bug. I already reported it.
>
> And I already replied ENOTABUG as promised ;-)
It's clear what the language should be doing in this situation and it isn't
doing it, so it's broken. It's only not a bug in the sense that it's
documented to
26 matches
Mail list logo