Jenn G. wrote:
Hello,
Hello,
I'm not sure if the syntax below is correct:
next if /\/0$|^127\./;
( the regex means when meet something like 192.168.1.0/0 or 127.0.0.1
it will be next.)
Or do I need to use () to enclose the char at both sides of the "|" ?
next if /(\/0$)|(^127\.)/;
No,
Hello,
I'm not sure if the syntax below is correct:
next if /\/0$|^127\./;
( the regex means when meet something like 192.168.1.0/0 or 127.0.0.1
it will be next.)
Or do I need to use () to enclose the char at both sides of the "|" ?
next if /(\/0$)|(^127\.)/;
Please help, thanks!
Regards.
Uri Guttman wrote:
>> "SB" == Steve Bertrand writes:
> >> again, what is unlike? i now guess it is from a test module. does it
> >> take a regex as an arg?
>
> SB> unlike is from Test::More. Both unlike and like take a regex as it's
> SB> second parameter. I took a quick look at the
> "SB" == Steve Bertrand writes:
SB> Uri Guttman wrote:
>>
SB> for my $known_type (@known_types) {
>>
SB> unless (exists $typedefs{$known_type} ) {
>>
>> again, you don't need exists there. since your dispatch table's values
>> are always code refs so they will always be tr
Uri Guttman wrote:
>> "SB" == Steve Bertrand writes:
>
> SB> In all honesty, I think I'm learning more about Perl (and my own
> SB> programs) writing the tests than I do when I'm writing the programs
> SB> themselves. (Same goes for keeping up with the documentation!).
>
> coding is co
> "SB" == Steve Bertrand writes:
SB> In all honesty, I think I'm learning more about Perl (and my own
SB> programs) writing the tests than I do when I'm writing the programs
SB> themselves. (Same goes for keeping up with the documentation!).
coding is coding and the more you do the mor
Uri Guttman wrote:
>> "SB" == Steve Bertrand writes:
>
> SB> I create %typedefs hash, where each key is a name which has a value of a
> SB> coderef that simply creates and returns a hash. Then:
>
> SB> my @data_types = $vardb->is_type();
> SB> my @missing_types;
>
> SB> for (@data
On Fri Jul 17 2009 @ 3:18, Octavian Rasnita wrote:
> From: "Shawn H. Corey"
>> Octavian Rasnita wrote:
>>> Well, in PHP that calculation is made well, so I think there is a bug
>>> in perl.
>>>
>>
>> No, it's not. PHP rounds off the number before printing. In Perl:
>>
>> printf "%.2f", $x;
>>
> "SB" == Steve Bertrand writes:
SB> I create %typedefs hash, where each key is a name which has a value of a
SB> coderef that simply creates and returns a hash. Then:
SB> my @data_types = $vardb->is_type();
SB> my @missing_types;
SB> for (@data_types) {
use named vars instead of
Shawn H. Corey wrote:
> Steve Bertrand wrote:
>> I also really like your suggestion of putting the hashes within a sub.
>> This will prevent the reset of ALL the data types each time new tests
>> are run.
>>
>
> You may want to look at dclone() from Storable. It clones deeply nested
> structures.
Steve Bertrand wrote:
I also really like your suggestion of putting the hashes within a sub.
This will prevent the reset of ALL the data types each time new tests
are run.
You may want to look at dclone() from Storable. It clones deeply nested
structures.
#!/usr/bin/perl
use strict;
use w
Uri Guttman wrote:
>> "SB" == Steve Bertrand writes:
>
> SB> I make these hashes available globally, initially as undef. I have a
>
> there is no such thing as an undef hash. it is either empty or
> not. undef is a single value and hashes are always in pairs. never do
> undef %hash or even
> "SB" == Steve Bertrand writes:
SB> I make these hashes available globally, initially as undef. I have a
there is no such thing as an undef hash. it is either empty or
not. undef is a single value and hashes are always in pairs. never do
undef %hash or even worse %hash = undef (the latter
Hi everyone,
In the test files I have that are used for testing the properties and
qualities of a data/type validator,
I make these hashes available globally, initially as undef. I have a
reset() function that defines and populates the data types (all hashes)
to a default state with default value
Rajini Naidu wrote:
On Tue, Jul 14, 2009 at 5:02 PM, John W. Krahn wrote:
Rajini Naidu wrote:
I have the below commands in the script.
`$swlist -l bundle -a revision -a architecture -s $t | $grep $n >>
$log_our_depot`;
`$swlist -l bundle -a revision -a architecture -s $t | $grep $n >>
$log
From: "Shawn H. Corey"
Octavian Rasnita wrote:
Well, in PHP that calculation is made well, so I think there is a bug in
perl.
No, it's not. PHP rounds off the number before printing. In Perl:
printf "%.2f", $x;
or
$x = sprintf "%.2f", $x;
Ok, thank you all for your help.
Octavian
Octavian Rasnita wrote:
Well, in PHP that calculation is made well, so I think there is a bug in
perl.
No, it's not. PHP rounds off the number before printing. In Perl:
printf "%.2f", $x;
or
$x = sprintf "%.2f", $x;
--
Just my 0.0002 million dollars worth,
Shawn
Programming is a
The basic issue is one of representation -- your represent numbers in
base 10 (decimal); the Machine represents numbers in base 2 (binary).
When you (or the Machine) translates between bases, there may be some
loss in precision -- a number that is finite, terminating fraction in
base19 (0.78, for
From: "Thomas Bätzler"
Octavian Rasnita asked:
I have tried the following calculation with ActivePerl 5.10.0 build 1004
under Windows XP Pro:
print 0.79 - 0.798;
And it gave the following result:
-0.00801
which is obviously wrong.
No, it isn't. Welcome to the wonderful world o
Paul Johnson wrote:
> On Fri, Jul 17, 2009 at 12:26:58PM +0200, Thomas Bätzler wrote:
> > Octavian Rasnita asked:
> > > I have tried the following calculation with ActivePerl 5.10.0 build
> > > 1004 under Windows XP Pro:
> > >
> > > print 0.79 - 0.798;
> > >
> > > And it gave the following result
Paul Johnson wrote:
On Fri, Jul 17, 2009 at 12:26:58PM +0200, Thomas Bätzler wrote:
Octavian Rasnita asked:
I have tried the following calculation with ActivePerl 5.10.0 build 1004
under Windows XP Pro:
print 0.79 - 0.798;
And it gave the following result:
-0.00801
which
On Fri, Jul 17, 2009 at 12:26:58PM +0200, Thomas Bätzler wrote:
> Octavian Rasnita asked:
> > I have tried the following calculation with ActivePerl 5.10.0 build 1004
> > under Windows XP Pro:
> >
> > print 0.79 - 0.798;
> >
> > And it gave the following result:
> > -0.00801
> >
> >
Octavian Rasnita asked:
> I have tried the following calculation with ActivePerl 5.10.0 build 1004
> under Windows XP Pro:
>
> print 0.79 - 0.798;
>
> And it gave the following result:
> -0.00801
>
> which is obviously wrong.
No, it isn't. Welcome to the wonderful world of machine
Hi,
I have tried the following calculation with ActivePerl 5.10.0 build 1004
under Windows XP Pro:
print 0.79 - 0.798;
And it gave the following result:
-0.00801
which is obviously wrong.
It doesn't matter too much the reasons, but is there a better way for doing
such math calc
Thank You for correcting me, indeed binding operator has higher precedence than
other operators. I apologise for making a hotch potch out of the entire
solution. I confused it thinking you posted this issue, and didnt see that you
were the one answering it.
Yes, your answer is much better.
Th
25 matches
Mail list logo