On Sun, Sep 25, 2022 at 12:02 PM Mike wrote:
>
> Your version produces this output in Perl 5.30.0:
>
> this
> that
> Use of uninitialized value $element in concatenation (.) or string at
> trash.pl line 14.
>
> Use of uninitialized value $element in concatenation (.) or string at
> trash.pl line
Your version produces this output in Perl 5.30.0:
this
that
Use of uninitialized value $element in concatenation (.) or string at
trash.pl line 14.
Use of uninitialized value $element in concatenation (.) or string at
trash.pl line 14.
Use of uninitialized value $element in concatenation (
Hello
Try with this code:
use strict;
use warnings;
use Data::Dumper;
my @words = ("this","that");
# With this code
$words[5] = "bad idea";
print Dumper \@words;
And it outputs:
$VAR1 = [
'this',
'that',
undef,
undef,
undef,
'bad i
What happen with my code?
use strict;
use warnings;
use diagnostics;
my @words = ("this","that");
# With this code
$words[5] = "bad idea";
for my $element (@words){
print "$element\n";
}
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"words.pl" 13L, 167B 1,1
Hi Raj,
On Thu, 14 Apr 2016 16:15:08 +
Raj Barath wrote:
> I was wrong. Please don't use my example.
> Aaron wells explanation is perfect.
>
Thanks for admitting you were wrong - many people fail to do so. I agree that
Aaron Wells's explanation appears to be very good, and one can find mor
rayref[0], or $arrayref->[0]
@one_val_slice = @{ $arrayref }[0]; # or @$arrayref[0], or ( $arrayref->[0] )
@three_val_slice = @{ $arrayref }[0..2]; # or @$arrayref[0..2]
Fundamentally, arrays and hashes can only hold scalar values. All a hash ref or
array ref is, is a scalar value that act
rayref[0], or $arrayref->[0]
@one_val_slice = @{ $arrayref }[0]; # or @$arrayref[0], or ( $arrayref->[0] )
@three_val_slice = @{ $arrayref }[0..2]; # or @$arrayref[0..2]
Fundamentally, arrays and hashes can only hold scalar values. All a hash ref or
array ref is, is a scalar value that act
ef
$count = @{ $arrayref }; # or, @$arrayref
$single_val = ${ $arrayref }[0]; # or $$arrayref[0], or $arrayref->[0]
@one_val_slice = @{ $arrayref }[0]; # or @$arrayref[0], or ( $arrayref->[0] )
@three_val_slice = @{ $arrayref }[0..2]; # or @$arrayref[0..2]
Fundamentally, arrays and hashes ca
Hello Raj,
On Thu, 14 Apr 2016 03:52:56 +
Raj Barath wrote:
> Hello Kenneth,
>
> Check this out:
>
> use v5.22;
> use Data::Dumper;
>
> my $VAR1;
>
> $VAR1 = [
> bless( {
>'Id' => [
>'01tC003udXAIAY',
>
Hello Kenneth,
Check this out:
use v5.22;
use Data::Dumper;
my $VAR1;
$VAR1 = [
bless( {
'Id' => [
'01tC003udXAIAY',
'01tC003udXAIAY'
],
'type' => 'Product2'
Hello Kenneth,
Check this out:
use v5.22;
use Data::Dumper;
my $VAR1;
$VAR1 = [
bless( {
'Id' => [
'01tC003udXAIAY',
'01tC003udXAIAY'
],
'type' => 'Product2'
On Wed, Apr 13, 2016 at 7:13 PM, Ken Slater wrote:
>
> On Wed, Apr 13, 2016 at 9:29 PM, Kenneth Wolcott
> wrote:
>>
>> Hi;
>>
>> I have the following output from Data::Dumper and I want to extract
>> the first string that the "Id" name points to.
>>
>> $VAR1 = [
>> bless( {
>>
On 04/13/2016 08:29 PM, Kenneth Wolcott wrote:
Hi;
I have the following output from Data::Dumper and I want to extract
the first string that the "Id" name points to.
$VAR1 = [
bless( {
'Id' => [
'01tC003udXAIAY',
On Wed, Apr 13, 2016 at 9:29 PM, Kenneth Wolcott
wrote:
> Hi;
>
> I have the following output from Data::Dumper and I want to extract
> the first string that the "Id" name points to.
>
> $VAR1 = [
> bless( {
>'Id' => [
>'01tC003udXAI
Hi;
I have the following output from Data::Dumper and I want to extract
the first string that the "Id" name points to.
$VAR1 = [
bless( {
'Id' => [
'01tC003udXAIAY',
'01tC003udXAIAY'
return ($a, $b);
>>>> }
>>>>
>>>>
>>>> anymore because you could, by mistake (or intentionally), write
>>>>
>>>>
>>>> my $x = s;
>>>>
>>>>
>>>> . So let me re-phrase my
Kent Fredric writes:
> On 26 January 2016 at 12:02, Nathan Hilterbrand wrote:
>> return wantarray() ? ($a, $b) : [$a, $b];
>>
>> In a list context, you get back a list.. otherwise you get back a reference
>> to a list. Might not be what you want, though.
&
On 26 January 2016 at 12:02, Nathan Hilterbrand wrote:
> return wantarray() ? ($a, $b) : [$a, $b];
>
> In a list context, you get back a list.. otherwise you get back a reference
> to a list. Might not be what you want, though.
>
> Works with arrays, too..
>
> my @a
like
sub s {
my $a = 1;
my $b = 3;
return ($a, $b);
}
anymore because you could, by mistake (or intentionally), write
my $x = s;
. So let me re-phrase my original question to: How do you /safely/
return arrays?
That means I need an error message for '$x = s;' because
Shlomi Fish writes:
> Hi lee,
>
> I should note that it is my impression that you are far too needy in your
> enquiring, and I'm starting to lose patience.
>
> On Mon, 25 Jan 2016 00:11:43 +0100
> lee wrote:
>
>> Shlomi Fish writes:
>>
>> >> >
>> >> > In scalar context the comma operator evalu
s like
>>
>>
>> sub s {
>> my $a = 1;
>> my $b = 3;
>>
>>return ($a, $b);
>> }
>>
>>
>> anymore because you could, by mistake (or intentionally), write
>>
>>
>> my $x = s;
>>
>>
>
use it to create convoluted code, which is usually not my intention.
>
> Consider with these examples that an expression like (1, 3) might
> unexpectedly evaluate to 3, and you start to think that you don't like
> things like
>
>
> sub s {
> my $a = 1;
> my $
Hi lee,
I should note that it is my impression that you are far too needy in your
enquiring, and I'm starting to lose patience.
On Mon, 25 Jan 2016 00:11:43 +0100
lee wrote:
> Shlomi Fish writes:
>
> >> >
> >> > In scalar context the comma operator evaluates its left-hand side,
> >> > throws
create convoluted code, which is usually not my intention.
Consider with these examples that an expression like (1, 3) might
unexpectedly evaluate to 3, and you start to think that you don't like
things like
sub s {
my $a = 1;
my $b = 3;
return ($a, $b);
}
anymore becau
Shlomi Fish writes:
>> >
>> > In scalar context the comma operator evaluates its left-hand side,
>> > throws it away and returns the right-hand side.
>>
>> What is the useful use for this operator?
>>
>
> Well, I believe its use was originally inherited from
> https://en.wikipedia.org/wiki/C_
On Sun, 24 Jan 2016 20:03:29 +0100
Paul Johnson wrote:
> On Sun, Jan 24, 2016 at 05:44:14PM +0200, Shlomi Fish wrote:
> > Hi lee,
> >
> > On Sun, 24 Jan 2016 13:11:37 +0100
> > lee wrote:
> >
> > > Paul Johnson writes:
> > > >
> > > > In scalar context the comma operator evaluates its lef
On Sun, Jan 24, 2016 at 05:44:14PM +0200, Shlomi Fish wrote:
> Hi lee,
>
> On Sun, 24 Jan 2016 13:11:37 +0100
> lee wrote:
>
> > Paul Johnson writes:
> > >
> > > In scalar context the comma operator evaluates its left-hand side,
> > > throws it away and returns the right-hand side.
> >
> > W
Hi lee,
On Sun, 24 Jan 2016 13:11:37 +0100
lee wrote:
> Paul Johnson writes:
>
> > On Tue, Sep 09, 2014 at 03:12:00PM -0700, Jim Gibson wrote:
> >>
> >> On Sep 9, 2014, at 2:57 PM, Shawn H Corey wrote:
> >>
> >> > On Tue, 09 Sep 2014 23:09:52 +0200
> >> > lee wrote:
> >> >
> >> >> my
Paul Johnson writes:
> On Tue, Sep 09, 2014 at 03:12:00PM -0700, Jim Gibson wrote:
>>
>> On Sep 9, 2014, at 2:57 PM, Shawn H Corey wrote:
>>
>> > On Tue, 09 Sep 2014 23:09:52 +0200
>> > lee wrote:
>> >
>> >> my $i = 1;
>> >> my $f = 2.5;
>> >> my $s = 'string';
>> >> my $list = (1, 2, 3);
>>
seful from your problem domain).
Final code
https://gist.github.com/elcamlost/54f32cd48ae1106052e0
чт, 2 июля 2015 г. в 13:03, Nathalie Conte :
> HI Shlomi,
> Thanks for your comments about best practise which I have implemented, Any
> ideas on why my hash of arrays of arrays is misbehavin
HI Shlomi,
Thanks for your comments about best practise which I have implemented, Any
ideas on why my hash of arrays of arrays is misbehaving?
Thanks
Nat
On 1 Jul 2015, at 15:42, Shlomi Fish wrote:
> Hi Nat,
>
> some comments about your code.
>
> On Wed, 1 Jul 2015 13:00
data10
> gene bal3 data5 data6 data12
> gene bal4 data7 data8 data12
>
> I take each data variable, see above, from a sql query and parse the data
> to build a new data structure: a hash of arrays of arrays.
> In the input data presented here, the fi
and parse the data
to build a new data structure: a hash of arrays of arrays.
In the input data presented here, the first column will be the key of the
hash and the other 4 columns should compose 4 arrays.
example :Each gene (gene a gene b ..) should be the keys, the al column
should be the first
Subject: Re: reading a hash of arrays
On Wed, 19 Nov 2014 17:03:40 -0600
"Frank K." wrote:
> I can't do @array1 = @hash{one};
@array1 = @{ $hash{one} };
$hash{one} contains a reference to an array. By dereferencing it with @{ ...
}, you get the array.
--
Don't
On Wed, 19 Nov 2014 17:03:40 -0600
"Frank K." wrote:
> I can't do @array1 = @hash{one};
@array1 = @{ $hash{one} };
$hash{one} contains a reference to an array. By dereferencing it with
@{ ... }, you get the array.
--
Don't stop where the ink does.
Shawn
--
To unsubscribe, e-mail: b
Have a hash of arrays.. i.e.
$hash{one}[0] = "value 10";
$hash{one}[1] = "value 11";
$hash{one}[2] = "value 11";
$hash{one}[3] = "value 13";
$hash{one}[0] = "value 20";
$hash{one}[1] = "value 21";
$hash{one}[2] = "value 22&
On Tue, Sep 16, 2014 at 02:43:28PM -0500, Andy Bach wrote:
> On Tue, Sep 16, 2014 at 1:45 PM, Paul Johnson wrote:
>
> > The comma operator evaluates its LHS, throws it away, evaluates its RHS
> > and returns that. The comma operator is left associative (see perlop).
> >
> > So the result of eval
On Tue, Sep 16, 2014 at 1:45 PM, Paul Johnson wrote:
> The comma operator evaluates its LHS, throws it away, evaluates its RHS
> and returns that. The comma operator is left associative (see perlop).
>
> So the result of evaluating the RHS (1, 2, 3) is:
>
> (1, 2, 3) -> ((1, 2), 3) -> (2, 3) -
On Tue, Sep 16, 2014 at 12:12:05PM -0500, Andy Bach wrote:
>The other thing to think
> about is "context" - the LHS of the assigning "=" determines how the RHS
> list is treated.
So far, so good. Well, almost ...
> In scalar c
On Tue, Sep 16, 2014 at 4:22 AM, Uday Vernekar
wrote:
> Confusion on array and list. can anybody explain me the difference between
> list and arrays.
>
> my @xyz = ( 4, 5, 6 );
>
> The right-hand side of the equals sign is a list.here I assign that list
> to the variable
Confusion on array and list. can anybody explain me the difference between
list and arrays.
my @xyz = ( 4, 5, 6 );
The right-hand side of the equals sign is a list.here I assign that list to
the variable @xyz.
its an array,list can be assigned to an array.
on similiar lines
we can assign Lists
On Tue, Sep 09, 2014 at 03:12:00PM -0700, Jim Gibson wrote:
>
> On Sep 9, 2014, at 2:57 PM, Shawn H Corey wrote:
>
> > On Tue, 09 Sep 2014 23:09:52 +0200
> > lee wrote:
> >
> >> my $i = 1;
> >> my $f = 2.5;
> >> my $s = 'string';
> >> my $list = (1, 2, 3);
> >
> > No, the count of items in the
man wrote:
> to be a little more exact, lists live only in expressions and are on
> the stack. arrays can live between statements and are allocated from
> the heap.
That isn't much help since the Perl documentation does not mention the
calling stack or the heap (except `perldoc pe
On 09/09/2014 06:01 PM, John SJ Anderson wrote:
On Tue, Sep 9, 2014 at 2:57 PM, Shawn H Corey wrote:
Lists are sequences used by Perl. They are very short lived, seldom
longer than one statement.
The way I've always liked to explain this is that arrays are the
containers you use to st
On Sep 9, 2014, at 2:57 PM, Shawn H Corey wrote:
> On Tue, 09 Sep 2014 23:09:52 +0200
> lee wrote:
>
>> my $i = 1;
>> my $f = 2.5;
>> my $s = 'string';
>> my $list = (1, 2, 3);
>
> No, the count of items in the list gets stored in $list: $list == 3
Unless the thing on the right-hand-side of t
t;> elements. References are scalars.
>>
>> The second example returns ( 1, 2, 3 ), which is a list with 3 elements.
>>
>> So, yes, there is a difference.
>
> Hm, so what way of thinking is behind this, and how do you declare an
> array?
Perls 1-4 (I believ
On Tue, Sep 9, 2014 at 2:57 PM, Shawn H Corey wrote:
> Lists are sequences used by Perl. They are very short lived, seldom
> longer than one statement.
The way I've always liked to explain this is that arrays are the
containers you use to store a list.
As Shawn says, a list is usu
ence;
my @dereferenced_list = @$list_reference
> my @artificial_array = $@list_reference;
my @artificial_array = @$list_reference;
> my @true_array = ?
>
>
> I'm finding this very confusing. What's the benefit of using extra
> designators for some types of variables (ar
reference;
my @true_array = ?
I'm finding this very confusing. What's the benefit of using extra
designators for some types of variables (arrays) while not even having
any at all for some others (lists)?
>> ? And my understanding was/is that in
>>
>> sub myfunc {
>
On Tue, 09 Sep 2014 00:13:13 +0200
lee wrote:
> Shawn H Corey writes:
>
> > On Mon, 18 Aug 2014 16:17:53 +0800
> > Ken Peng wrote:
> >
> >> sub myfunc {
> >> my @x=(1,2,3);
> >> return \@x;
> >> }
> >>
> >> # or,
> >>
> >> sub myfunc {
> >> my @x=(1,2,3);
> >> return [@x];
> >> }
> >
On Sep 8, 2014, at 3:13 PM, lee wrote:
> Shawn H Corey writes:
>
>> On Mon, 18 Aug 2014 16:17:53 +0800
>> Ken Peng wrote:
>>
>>> sub myfunc {
>>> my @x=(1,2,3);
>>> return \@x;
>>> }
>>>
>>> # or,
>>>
>>> sub myfunc {
>>> my @x=(1,2,3);
>>> return [@x];
>>> }
>>
>> # or
>>
>> sub myfu
Shawn H Corey writes:
> On Mon, 18 Aug 2014 16:17:53 +0800
> Ken Peng wrote:
>
>> sub myfunc {
>> my @x=(1,2,3);
>> return \@x;
>> }
>>
>> # or,
>>
>> sub myfunc {
>> my @x=(1,2,3);
>> return [@x];
>> }
>
> # or
>
> sub myfunc {
> return [ 1, 2, 3 ];
> }
Is there a difference to
su
On Jul 10, 2014, at 11:50 AM, Natxo Asenjo wrote:
> On Thu, Jul 10, 2014 at 1:00 AM, Jim Gibson wrote:
>
> On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote:
> > On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson wrote:
> > On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote:
>
> In order to use the hash m
On Thu, Jul 10, 2014 at 1:00 AM, Jim Gibson wrote:
>
> On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote:
> > On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson
> wrote:
> > On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote:
>
> In order to use the hash method of determining uniqueness, you must
> convert
};
I guess you want output something like this .
> From: p...@surfshopcart.com
> Subject: Creating a hash of arrays from
> Date: Wed, 9 Jul 2014 18:59:58 -0700
> To: beginners@perl.org
>
> I'm having a problem creating a hash of arrays. The while loop below
> works,
On Jul 10, 2014, at 9:00 AM, Ron Bergin wrote:
> my($state, @zipcodes) = split /[=,]/, $line;
Interesting concept, the multiple split. I'd be interested in knowing
how Perl knows to give the singular value on the left of the "=" to $state and
all other values split on the "," to @zipcod
Ron Bergin wrote:
> Others have already pointed what you were doing wrong, so I'll point out
> something else.
>
> Instead of using 2 separate split statements, I'd use a single split
> statement to assign $state and a @zipcodes array.
>
> use 5.010;
> use strict;
> use warnings;
> use Data::Dumpe
SSC_perl wrote:
> If someone could explain what I'm doing wrong, I'd appreciate it. I
> just
> can't see it.
>
> Thanks,
> Frank
>
> --
>
> use strict;
> use warnings;
> use 5.010;
>
> use Data::Dumper;
>
> my %entries;
>
> while (my $line = ) {
> chomp $line;
Hi Frank
On 07/10/2014 11:02 AM, SSC_perl wrote:
On Jul 10, 2014, at 7:14 AM, Nathan Hilterbrand wrote:
$entries{$state} = [ (split /,/ => $zipcodes) ];
Thanks, Nathan. The line above caught my eye. It's interesting to see
that you don't need both 'push' and 'split' to populate th
On Jul 10, 2014, at 7:14 AM, Nathan Hilterbrand wrote:
> $entries{$state} = [ (split /,/ => $zipcodes) ];
Thanks, Nathan. The line above caught my eye. It's interesting to see
that you don't need both 'push' and 'split' to populate the hash.
Could you explain a little about wh
On Jul 9, 2014, at 7:56 PM, John SJ Anderson wrote:
> This foreach loop is looping over the five zip codes in the array...
>
>> print Dumper (@{$entries{$state}});
>
> And printing out the same array each time.
Thanks, John. I wasn't even looking at the printout loop. :\ For
so
On Wed, Jul 9, 2014 at 6:59 PM, SSC_perl wrote:
> If someone could explain what I'm doing wrong, I'd appreciate it. I
> just can't see it.
You're looping over the entries in the array, not the entries in the hash.
> foreach my $state (sort keys %entries) {
> say "The Zip Codes of $
I'm having a problem creating a hash of arrays. The while loop below
works, but it's working too well. ;) Instead of giving me 5 values (from the
example data below), it's giving me 25. I don't understand why it seems to be
"looping" through the push
On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote:
>
>
>
> On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson wrote:
>
> On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote:
>
> > hi,
> >
> > i have an array of arrays which contains equal elements. I would like to
On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson wrote:
>
> On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote:
>
> > hi,
> >
> > i have an array of arrays which contains equal elements. I would like to
> isolate the unique values.
>
> Do you mean that the subarra
On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote:
> hi,
>
> i have an array of arrays which contains equal elements. I would like to
> isolate the unique values.
Do you mean that the subarrays contain equal NUMBERS of elements?
>
> I have tried using the uniq method of List
hi,
i have an array of arrays which contains equal elements. I would like to
isolate the unique values.
I have tried using the uniq method of List::MoreUtils but it apparently
does not work with an AoA.
This is what I tried:
for my $i ( @$data_ref ) {
push $seen_ref, [ $i->{'valu
my @animals = @$animals; # dereference
my @digits = @$digits; # dereference
The comment is inaccurate.
Why would you want to copy the arrays?
Because I don't want to change an array by my subroutine, as Shawn H
Corey answered already.
Well, this may or may not be eventual's intentio
> >my @animals = @$animals; # dereference
> >my @digits = @$digits; # dereference
>
> The comment is inaccurate.
>
> Why would you want to copy the arrays?
So you could can their contents without the contents of the arrays in
the caller being changed.
>
>
you want to copy the arrays?
print Dumper(@animals, @digits); # just look ...
Consider: print Dumper( $animals, $digits );
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 09/07/2013 01:11 PM, eventual wrote:
Hi,
In the example below, how do I pass @pets and @numbers into the
subroutine so that
@animals = @pets and
@digits = @numbers.
Thanks
my @pets = ('dogs' , 'cats' , 'horses');
my @numbers = (1..10);
&study (@pets , @numbers);
sub study {
my (@animals
Greetings,
You cannot pass two arrays as the previous array will slurp (consume) all the
elements. You need to go for references.
Here is one way to do it
[code]
use strict;
use warnings;
my @pets = ('dogs' , 'cats' , 'horses');
my @numbers = (1..10);
&
Hi Eventual,
On Sat, 7 Sep 2013 04:11:06 -0700 (PDT)
eventual wrote:
> Hi,
>
> In the example below, how do I pass @pets and @numbers into the subroutine so
> that @animals = @pets and
> @digits = @numbers.
Please look into references and pass the arrays as references. Se
Hi,
In the example below, how do I pass @pets and @numbers into the subroutine so
that
@animals = @pets and
@digits = @numbers.
Thanks
my @pets = ('dogs' , 'cats' , 'horses');
my @numbers = (1..10);
&study (@pets , @numbers);
sub study {
my (@animals, @digits) = (@_[0] , @_[1]);
On Thu, Aug 23, 2012 at 05:19:34PM -0400, Shawn H Corey wrote:
> You're trying to do too much in one statement.
>
> for my $coord ( @coords ){
> if( $coords->[0] >= 0 ){
> print join( q{, }, @{ $coords } ), "\n";
> }
> }
Looks like you're trying to do too much too. ;) You are test
On Thu, 23 Aug 2012 14:17:26 -0700
Jim Gibson wrote:
> You could also combine print, grep, and map to accomplish the same
> thing.
Please don't. If you're having this much trouble getting it right, the
person stuck with maintaining it will also have trouble understanding
what you coded. Break it
On Thu, 23 Aug 2012 15:58:43 -0500
Chris Stinemetz wrote:
> print grep { $_->[0] >= 0 } @coords;
You're trying to do too much in one statement.
for my $coord ( @coords ){
if( $coords->[0] >= 0 ){
print join( q{, }, @{ $coords } ), "\n";
}
}
--
Just my 0.0002 million dolla
On Aug 23, 2012, at 1:58 PM, Chris Stinemetz wrote:
>>
>>
>> If @coords is just an Array of Arrays then that should be:
>>
>> print grep { $_->[0] >= 0 } @coords;
>>
>>
>> Your example thinks @coords is an Array of Arrays of Arrays.
&g
>
>
> If @coords is just an Array of Arrays then that should be:
>
> print grep { $_->[0] >= 0 } @coords;
>
>
> Your example thinks @coords is an Array of Arrays of Arrays.
>
>
> John
> --
>
print grep { $_->[0] >= 0 } @coords;
Just prints the m
On Aug 23, 2012, at 12:57 PM, Chris Stinemetz wrote:
> Hello List,
> I'm trying to grep an array of arrays, but I am getting the following error:
>
> Can't use string ("1") as an ARRAY ref while "strict refs" in use at
> form.pl line 121, <
Chris Stinemetz wrote:
Hello List,
Hello,
I'm trying to grep an array of arrays, but I am getting the following error:
Can't use string ("1") as an ARRAY ref while "strict refs" in use at
form.pl line 121,<$COORDS> line 1281.
Press any key to continue
Hello List,
I'm trying to grep an array of arrays, but I am getting the following error:
Can't use string ("1") as an ARRAY ref while "strict refs" in use at
form.pl line 121, <$COORDS> line 1281.
Press any key to continue . . .
Below is the grep stat
$type, ref(code): " . ref($code);
+next TEST;
+}
+}
+}
+my $sub = eval "sub { $init (" . join(", ", @code) . ") }";
+my $sorter = Sort::Key::multi
On 08/23/2012 09:10 AM, Uri Guttman wrote:
> On 08/23/2012 02:54 AM, Salvador Fandino wrote:
>
>>>
>>> It's a pity Sort::Maker not in Debian
>>
>> There is also Sort::Key, available in Debian testing and unstable, and
>> which is usually faster than Sort::Maker and also Sort::Key::Radix, even
>> f
On Thu, Aug 23, 2012 at 9:10 AM, Uri Guttman wrote:
> On 08/23/2012 02:54 AM, Salvador Fandino wrote:
>
>
>>> It's a pity Sort::Maker not in Debian
>>>
>>
>> There is also Sort::Key, available in Debian testing and unstable, and
>> which is usually faster than Sort::Maker and also Sort::Key::Radi
On 08/23/2012 02:54 AM, Salvador Fandino wrote:
It's a pity Sort::Maker not in Debian
There is also Sort::Key, available in Debian testing and unstable, and
which is usually faster than Sort::Maker and also Sort::Key::Radix, even
faster when sorting by numeric keys but not available in Debian
On 08/22/2012 10:34 PM, Eduardo wrote:
> On 22/08/12 03:49, Uri Guttman wrote:
>> On 08/21/2012 08:29 PM, Eduardo wrote:
>>> how would you do with Sort::Maker?
>> i don't have time to show an example now but it is much cleaner
>> looking. all you need to do is code up how you extract each key from
On 22/08/12 03:49, Uri Guttman wrote:
> On 08/21/2012 08:29 PM, Eduardo wrote:
>> how would you do with Sort::Maker?
> i don't have time to show an example now but it is much cleaner
> looking. all you need to do is code up how you extract each key from
> the data set and how it gets sorted (number
On 08/21/2012 08:29 PM, Eduardo wrote:
On 22/08/12 00:35, Uri Guttman wrote:
my %cache = ();
foreach ( keys %$hash )
{
my ( $naa, $nab ) = $_ =~ m|^(\d+)-(\d+)|;
$cache{ ($naa * 100 + $nab ) } = $_;
}
that is a variant of the orcish manoever which is supported by sort::maker.
fore
On 22/08/12 00:35, Uri Guttman wrote:
> On 08/21/2012 05:33 PM, Eduardo wrote:
>> On 21/08/12 22:05, Chris Stinemetz wrote:
>>> Hello List,
>>>
>>> I am trying to sort a hash of arrays ( example below: )
>>>
>>> I would the sort to so
On 08/21/2012 05:33 PM, Eduardo wrote:
On 21/08/12 22:05, Chris Stinemetz wrote:
Hello List,
I am trying to sort a hash of arrays ( example below: )
I would the sort to sort in ascending order the first index of the array
then the second index of the array.
So in this example the arrays
On 21/08/12 22:05, Chris Stinemetz wrote:
> Hello List,
>
> I am trying to sort a hash of arrays ( example below: )
>
> I would the sort to sort in ascending order the first index of the array
> then the second index of the array.
>
> So in this example the arrays would
I will leave it to you to write an actual program incorporating these
> ideas.
>
> Thank you Jim for the excelent explanation.
This seems to do the trick.
foreach my $cellNo ( sort { $hash{$a}->[0] <=> $hash{$b}->[0] ||
$hash{$a}->[1] <=> $hash{$b}->[1] } keys %hash ) {
print join( "\0", @{
On Aug 21, 2012, at 1:23 PM, Jim Gibson wrote:
>
> On Aug 21, 2012, at 1:05 PM, Chris Stinemetz wrote:
>
>> Hello List,
>>
>> I am trying to sort a hash of arrays ( example below: )
>>
>> I would the sort to sort in ascending order the first index of th
On Aug 21, 2012, at 1:05 PM, Chris Stinemetz wrote:
> Hello List,
>
> I am trying to sort a hash of arrays ( example below: )
>
> I would the sort to sort in ascending order the first index of the array
> then the second index of the array.
I believe you mean "fir
On Tue, Aug 21, 2012 at 3:11 PM, Shawn H Corey wrote:
> On Tue, 21 Aug 2012 15:05:33 -0500
> Chris Stinemetz wrote:
>
> > I am trying to sort a hash of arrays ( example below: )
> >
> > I would the sort to sort in ascending order the first index of the
> > a
On Tue, 21 Aug 2012 15:05:33 -0500
Chris Stinemetz wrote:
> I am trying to sort a hash of arrays ( example below: )
>
> I would the sort to sort in ascending order the first index of the
> array then the second index of the array.
What have you tried so far? Can we see the code?
Hello List,
I am trying to sort a hash of arrays ( example below: )
I would the sort to sort in ascending order the first index of the array
then the second index of the array.
So in this example the arrays would sort to:
97,2,120,65
219,1,30,33
280,3,230,90
462,2,270,65
$VAR1
On 2012.06.06.04.06, Uri Guttman wrote:
> On 06/06/2012 03:58 AM, Wernher Eksteen wrote:
> >I have two arrays that I need to compare, and then print the differences:
>
> this is answered in the perl FAQ. please check that before you ask
> ...
Specifically, you can use &quo
On 06/06/2012 03:58 AM, Wernher Eksteen wrote:
Hi,
I have two arrays that I need to compare, and then print the differences:
this is answered in the perl FAQ. please check that before you ask what
could be a frequently asked question. in fact, i teach perl newbies to
read/skim the entire
1 - 100 of 1291 matches
Mail list logo