On 2014-01-07 20:28, Rajeev Prasad wrote:
so i have this series of numbers:
349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,425,426,427,428,429,430,431
On 01/07/2014 02:56 PM, David Precious wrote:
On Tue, 7 Jan 2014 13:35:39 -0600
Hal Wigoda wrote:
On Tue, Jan 7, 2014 at 1:28 PM, Rajeev Prasad <.ne...@yahoo.com>
wrote:
so i have this series of numbers:
[...]
there are two ranges in there: 349-396, 425-496
any hints as to how to write a perl
On Tue, 7 Jan 2014 13:35:39 -0600
Hal Wigoda wrote:
> On Tue, Jan 7, 2014 at 1:28 PM, Rajeev Prasad <.ne...@yahoo.com>
> wrote:
> > so i have this series of numbers:
> > [...]
> > there are two ranges in there: 349-396, 425-496
> >
> > any hints as to how to write a perl code to represent the ser
(349..396,425..496);
On Tue, Jan 7, 2014 at 1:28 PM, Rajeev Prasad wrote:
> so i have this series of numbers:
>
> 349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394
so i have this series of numbers:
349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,
On Jul 20, 6:09 pm, shawnhco...@gmail.com (Shawn H Corey) wrote:
> On 11-07-20 07:03 PM, Uri Guttman wrote:
>
> > the other is a class method call. it has two major differences. first it
> > will pass its class (or object, the arg before ->) as the first arg in
> > the call. the second thing is tha
On 21/07/2011 05:32, Rob Dixon wrote:
It would be possible to generate calls to undefined subroutines at
compile time, but because the symbol table can be modified at run time
with such trickery suck as *Foo::bar = \&Foo::foo it is also left until
run time to report any such errors.
My apolog
> "RD" == Rob Dixon writes:
RD> I'm not sure what you mean here Shawn. Errors are generated at run time
RD> in both cases, so code like
RD> if (0) {
RD> Foo::bar();
RD> }
RD> if (0) {
Foo-> bar();
RD> }
RD> will generate no errors at all. In particular the meth
On 21/07/2011 02:09, Shawn H Corey wrote:
On 11-07-20 07:03 PM, Uri Guttman wrote:
the other is a class method call. it has two major differences. first it
will pass its class (or object, the arg before ->) as the first arg in
the call. the second thing is that it will search the class hierarchy
On 11-07-20 07:03 PM, Uri Guttman wrote:
the other is a class method call. it has two major differences. first it
will pass its class (or object, the arg before ->) as the first arg in
the call. the second thing is that it will search the class hierarchy
(using the package global's @ISA) to find
Marc that was a really good question. On the surface they do seem exactly
alike.
Cheers!
- biskofski
On Jul 20, 2011, at 6:29 PM, Marc wrote:
> On Jul 20, 2011, at 4:03 PM, Uri Guttman wrote:
>
>> so don't think they are even similar as one is a sub call and the other
>> is a class method c
On Jul 20, 2011, at 4:03 PM, Uri Guttman wrote:
> so don't think they are even similar as one is a sub call and the other
> is a class method call. they aren't interchangeble at all
Yep, you're correct. Why is everything so simple once someone explains
it to you??? =;)
That al
> "M" == Marc writes:
M>I've noticed that the following two lines seem to be equivalent when
calling a sub from a module called Lib.pm:
Lib-> load_config("config.dat");
M> Lib::load_config("config.dat");
M>Is this just a case of TIMTOWTDI or is there a difference in how
I've noticed that the following two lines seem to be equivalent when
calling a sub from a module called Lib.pm:
Lib->load_config("config.dat");
Lib::load_config("config.dat");
Is this just a case of TIMTOWTDI or is there a difference in how they
do what they do?
Marc
--
To uns
Philip Potter wrote:
2009/11/4 David Lee :
[...]
Anyway, your explanation was useful and gives us sufficient to decide how to
address our local use of these numbers. (In our case, they are
human-oriented accumulated byte-counts, for which we don't actually need
that significance/precision.)
Philip Potter wrote:
I would guess that these numbers are being stored in floats, and that
these floats are 64-bit double precision, with 53 bits of mantissa.
That means that there are just under 16 decimal digits of precision in
these numbers. print and friends seem to automatically print no mo
2009/11/4 David Lee :
> Many thanks for the reply.
>
> Following the initial surprise, my main concern was that attempts to unearth
> a description or explanation (i.e. documentation) for the observed behaviour
> was so tricky. For instance, there was nothing obvious in the relevant
> parts of "Pr
eger; indeed it usually does so. But when its size takes it from 15
> decimal digits to 16 decimal digits, that "print" flips the output into
> scientific notation:
> 997
> 998
> 999
> 1e+15
> 1e+15
>
> Ouch. The surp
hen its size takes it
from 15 decimal digits to 16 decimal digits, that "print" flips the
output into scientific notation:
997
998
999
1e+15
1e+15
Ouch. The surprise is especially nasty when this output data is then
used as input
On Wed, Sep 9, 2009 at 09:46, Dermot wrote:
snip
> my $var = !! $class->method;
snip
This is really
my $var = ! ( ! $class->method );
People do this to create a boolean like value. Perl has many false
values and many true values:
False: (), "", "0", 0, 0.0, and undef
True: any value that expl
Dermot wrote:
Hi,
I saw this notation today:
!! $class->method;
or as an assignment:
my $var = !! $class->method;
I can't find a definition for it in perlsyn or perlop. I don't think
it's restricted to classes. I suspect this is boolean but I'd like to
know.
Any
Hi,
I saw this notation today:
!! $class->method;
or as an assignment:
my $var = !! $class->method;
I can't find a definition for it in perlsyn or perlop. I don't think
it's restricted to classes. I suspect this is boolean but I'd like to
know.
Any pointers?
Thanx,
Xavier Noria schreef:
> Detecting whether something holds in an array is the job of grep:
>
>my $numbers = grep /\A$RE{num}{real}\z/, @data;
>next unless $numbers == @data;
Alternative:
die if grep !/\A$RE{num}{real}\z/, @data;
my $numbers = scalar @data;
--
Affijn, Ruud
"Gewo
El Jul 19, 2007, a las 12:19 AM, Joseph L. Casale escribió:
Interesting,
I see from your regexp you use a \A and \z, from Perldoc this means:
\A Match only at beginning of string
\z Match only at end of string
I am not sure I understand this requirement?
^ and $ depend on flags, and
On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Chas,
Sorry but I am not clear on what you mean by reduce? Do you mean
remove all non numbers from the array?
snip
Sort of, the code doesn't modify the original array, it creates a new
array with only the values that are numbers.
--
To un
Subject: Re: Convert Scientific Notation to decimal equivalent
On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
> Interesting,
> I see from your regexp you use a \A and \z, from Perldoc this means:
> \A Match only at beginning of string
> \z Match only at end of st
On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Interesting,
I see from your regexp you use a \A and \z, from Perldoc this means:
\A Match only at beginning of string
\z Match only at end of string
Is "foo10bar" valid? /^$RE{num}{real}$/ says no, but /$RE{num}{real}/
says yes
5313 28.90625 0
>
> And my code is skipping some lines as it checks for any erroneous data:
> next if grep (/[^0-9.-]/, @data);
> But that thinks the scientific notation is bad. I searched the net and
> didn't find anything. How can I match this specific pattern and convert it?
Notation to decimal equivalent
El Jul 18, 2007, a las 11:19 PM, Joseph L. Casale escribió:
> How can I detect this, I have been running some code for a few days
> to develop some files and ran into the situation where I am getting
> the following data for input:
>
> 14.9
that thinks the scientific notation is bad. I searched the net
and didn't find anything. How can I match this specific pattern and
convert it?
I am not sure I understand the problem to solve.
You need to filter out lines that contain something that's *not* a
number? If that'
-14.45313 0
-14.95313 1.570813E-015 0
-14.95313 14.45312 0
14.95313 -28.90625 0
0 -28.90625 0
-14.95313 28.90625 0
0 28.90625 0
14.95313 28.90625 0
And my code is skipping some lines as it checks for any erroneous data:
next if grep (/[^0-9.-]/, @data);
But that thinks the scientific notation is bad. I
ks the scientific notation is bad. I searched the net and
didn't find anything. How can I match this specific pattern and convert it?
Thanks!
jlc
Don't write the regex yourself, use one of the ones in
Regexp::Common*. $RE{num}{real} is probably what you want.
As for how to make "
-015 0
-14.95313 14.45312 0
14.95313 -28.90625 0
0 -28.90625 0
-14.95313 28.90625 0
0 28.90625 0
14.95313 28.90625 0
And my code is skipping some lines as it checks for any erroneous data:
next if grep (/[^0-9.-]/, @data);
But that thinks the scientific notation is bad. I searched the net and
John W. Krahn wrote:
On Thursday 01 July 2004 14:30, Rob Benton wrote:
I'm looking for a little help here. I'm not understanding exactly
what's wrong with this code:
===
#!/usr/bin/perl -w
use strict;
open IN, "
my %rows;
while ()
{
c
On Thursday 01 July 2004 14:30, Rob Benton wrote:
>
> I'm looking for a little help here. I'm not understanding exactly
> what's wrong with this code:
>
> ===
> #!/usr/bin/perl -w
>
> use strict;
>
> open IN, "
> my %rows;
>
> while ()
>
Rob Benton wrote:
$rows{$fields[2]} = [ ($fields[3]..$fields[-1]) ];
Depending on what the fourth and last elements in @fields contain,
that range can be very, very long...
I think this is what you mean:
$rows{$fields[2]} = [ @fields[3..$#fields] ];
--
Gunnar Hjalmarsson
Email: http://www
Rob Benton <[EMAIL PROTECTED]> wrote:
: I'm looking for a little help here. I'm not understanding exactly
: what's wrong with this code:
:
: ===
: #!/usr/bin/perl -w
:
: use strict;
:
: open IN, ")
: {
: chomp;
: my @field
On Jul 1, Rob Benton said:
> $rows{$fields[2]} = [ ($fields[3]..$fields[-1]) ];
You're doing two things wrong: the '..' operator needs to be INSIDE the
subscript.
@fields[$lower .. $upper]
The other thing is that you can't do a range like that. If you want to
get the elements from [3] t
I'm looking for a little help here. I'm not understanding exactly
what's wrong with this code:
===
#!/usr/bin/perl -w
use strict;
open IN, "
my %rows;
while ()
{
chomp;
my @fields = split( /,/, $_);
$rows{$fields[2]} = [ ($f
Charles Lu said:
> Hi
Hello
> If i want to compare 2 values in scientific notation i.e.
>
> 1.2e-400 4.3e-200
>
>
> I cannot use simply use "< , > " operator. For some reason,
> 0 > 1e-400.
That's a pretty small number. On most 32 bit sys
Hi
If i want to compare 2 values in scientific notation i.e.
1.2e-400 4.3e-200
I cannot use simply use "< , > " operator. For some reason,
0 > 1e-400.
Is there a module I can use?
thanks
Charles
_
Get
> I wouldn't necessarily call it a bad habit as it does execute
> properly, it just doesn't produce as readable of code... Rob
> already covered -> well so I will just point you to some
> "light" reading if you thirst for more...
>
> perldoc perlreftut
> perldoc perlref
> perldoc perldsc
> per
Wiggins D Anconia wrote:
>
> > I think I am picking up some bad habits so maybe you guys can help.
> >
> > I currently use this notation @{$hash{key}} to access an array stored in
> > a hash.
> > I keep seeing posts that it is better to use an object like notatio
> I think I am picking up some bad habits so maybe you guys can help.
>
> I currently use this notation @{$hash{key}} to access an array stored in
> a hash.
> I keep seeing posts that it is better to use an object like notation.
> Can I see some examples on how you would acce
Paul Kraus wrote:
>
> I think I am picking up some bad habits so maybe you guys can help.
>
> I currently use this notation @{$hash{key}} to access an array stored in
> a hash.
> I keep seeing posts that it is better to use an object like notation.
> Can I see some examples on
I think I am picking up some bad habits so maybe you guys can help.
I currently use this notation @{$hash{key}} to access an array stored in
a hash.
I keep seeing posts that it is better to use an object like notation.
Can I see some examples on how you would access the array or an element
of an
On Jan 3, KAVANAGH, Michael said:
>*random_subroutine_name = sub ( ) { 1 };
>
>Is there a name for this kind of operation?
Typeglob assignment? Basically, you're assigning a code reference to a
typeglob, which makes &random_subroutine_name be that function. Compare
that with:
*x = [1,2,3];
Hi there
I've been re-working some code from another developer and I came across a
line that has me stumped. I can't find an explanation in Programming Perl,
but it's probably because I don't know what to look for.
The line is:
*random_subroutine_name = sub ( ) { 1 };
Is there a name for this k
In my response, shown below, if I replace
$rhash=shift; # My approach
with
$rhash=@_;# Your Approach
then nothing will be printed. The reason is that the results are interpreted
in a scalar notation when you adopt the latter approach. Therefore, never
attempt to do an
[EMAIL PROTECTED]
Sent: 11/15/2001 10:08 AM
Subject: Printing with arrow notation
I am passing a hash as a reference to a subroutine and want to print its
values using arrow notation. Such as..
%hash ("value1", "value2", etc..);
PrintHash(\%hash);
sub PrintHash
{
$rha
to a subroutine and want to print its
> values using arrow notation. Such as..
> %hash ("value1", "value2", etc..);
> PrintHash(\%hash);
>sub PrintHash
> {
> $rhash = @_;
> What woul
vandine [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 15, 2001 11:08 AM
To: [EMAIL PROTECTED]
Subject: Printing with arrow notation
I am passing a hash as a reference to a subroutine and want to print its
values using arrow notation. Such as..
%hash ("value1", "value2", et
I am passing a hash as a reference to a subroutine and want to print its
values using arrow notation. Such as..
%hash ("value1", "value2", etc..);
PrintHash(\%hash);
sub PrintHash
{
$rhash = @_;
What would work here for print using arro
> -Original Message-
> From: AMORE,JUAN (HP-Roseville,ex1) [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 13, 2001 10:58 PM
> To: Beginners@Perl. Org (E-mail)
> Subject: Trying to use the => notation to print the values from this
> hash
>
>
> Hel
ber 2001 03:58
> To: Beginners@Perl. Org (E-mail)
> Subject: Trying to use the => notation to print the values from this
> hash
>
>
> Hello Perl Gurus,
> I'm trying to print anyone of these values using the => notation.
> I believe I can use => but not so
On Wed, 2001-11-14 at 03:57, AMORE,JUAN (HP-Roseville,ex1) wrote:
> %Unix= ("SHELL" => "/bin/csh",
>"PAGER" => "more",
>"DB" => "mysql");
>
> print "Value: ,=> $unix{SHELL}\n";
The => in the last line is not necessary:
print "Value: ", $unix{"SHELL"}\n";
will DWYM.
As a side poin
Hello Perl Gurus,
I'm trying to print anyone of these values using the => notation.
I believe I can use => but not so sure how to use it.
Can someone give me an example,...I tried different ways but have exhausted
all means.
Any hints:)
Many Thanks!
%Unix= ("SHELL" =>
--- "Gross, Stephan" <[EMAIL PROTECTED]> wrote:
> I'm using Win32::GUI. I create a text field and call it $TextField.
> The
> user inputs some text, say "abc".
> If I say
> print "$TextField->Text";
> I get
> Win32::GUI::Textfield=HASH(0x23762b0)->Text
> If instead I say
> $x =
* Brett W. McCoy ([EMAIL PROTECTED]) [27 Jun 2001 21:22]:
> On Wed, 27 Jun 2001, Gross, Stephan wrote:
> > I'm using Win32::GUI. I create a text field and call it $TextField. The
> > user inputs some text, say "abc".
> > If I say
> > print "$TextField->Text";
> > I get
> > Win32::GUI::T
On Wed, 27 Jun 2001, Gross, Stephan wrote:
> I'm using Win32::GUI. I create a text field and call it $TextField. The
> user inputs some text, say "abc".
> If I say
> print "$TextField->Text";
> I get
> Win32::GUI::Textfield=HASH(0x23762b0)->Text
> If instead I say
> $x = $TextField-
I'm using Win32::GUI. I create a text field and call it $TextField. The
user inputs some text, say "abc".
If I say
print "$TextField->Text";
I get
Win32::GUI::Textfield=HASH(0x23762b0)->Text
If instead I say
$x = $TextField->Text;
print "$x";
I get
abc
Why the differenc
61 matches
Mail list logo