Re: What hash function to use

2018-08-25 Thread Luca Cappelletti
Il 23/08/2018 10:21, Olivier ha scritto: Илья Рассадин writes: Hi! See encpass from Passwd::Unix https://metacpan.org/pod/Passwd::Unix Thanbk you, but unless I miss something Password::Unix only provides MD5, not Blowfish. Best regards, Olivier this works? Crypt::Eksblowfish::Bcrypt -

Re: What hash function to use

2018-08-23 Thread Olivier
> different hashing functions for different passwords. It is not part of the > Bcrypt spec, but you > should be able to just add it on. Does the password hash correctly otherwise? > > https://passlib.readthedocs.io/en/stable/modular_crypt_format.html I confirm it is the format for a B

Re: What hash function to use

2018-08-23 Thread Chas. Owens
swords. > It is not part of the Bcrypt spec, but you should be able to just add it > on. Does the password hash correctly otherwise? > > https://passlib.readthedocs.io/en/stable/modular_crypt_format.html > > On Thu, Aug 23, 2018 at 8:30 AM Mike Flannigan wrote: > >> >&

Re: What hash function to use

2018-08-23 Thread Chas. Owens
That prefix appears to for the modular crypt format (see below) and lets the shadow file use different hashing functions for different passwords. It is not part of the Bcrypt spec, but you should be able to just add it on. Does the password hash correctly otherwise? https

Re: What hash function to use

2018-08-23 Thread Mike Flannigan
I hope somebody helps you with this. I don't think this will help you.  It sounds like you already know all of this: https://crackstation.net/hashing-security.htm I don't know what $2b$ is.  Still trying to figure that out. It looks like Digest::Bcrypt was last updated 3/2017. I hope it hasn't

Re: What hash function to use

2018-08-23 Thread Olivier
Илья Рассадин writes: > Hi! > > See encpass from Passwd::Unix > > https://metacpan.org/pod/Passwd::Unix Thanbk you, but unless I miss something Password::Unix only provides MD5, not Blowfish. Best regards, Olivier > > On 8/23/18 10:54 AM, Olivier wrote: >> Hello, >> >> I am not sure if my que

Re: What hash function to use

2018-08-23 Thread Илья Рассадин
Hi! See encpass from Passwd::Unix https://metacpan.org/pod/Passwd::Unix On 8/23/18 10:54 AM, Olivier wrote: Hello, I am not sure if my question is really of beginer level. On a system, I have set my password to "t410" and it has ben hashed to: $2b$10$OQBll77HJqnOR.zqK2jx8ukE6m68Azc7nrsgRdcT6

What hash function to use

2018-08-23 Thread Olivier
Hello, I am not sure if my question is really of beginer level. On a system, I have set my password to "t410" and it has ben hashed to: $2b$10$OQBll77HJqnOR.zqK2jx8ukE6m68Azc7nrsgRdcT6bVfERRmzFV4. What could I use with Perl to get the same result? I tried Digest::Bcrypt but it does not support

Re: tie a hash to a file

2018-08-05 Thread Brad Lhotsky
ed as you scale. But, it's not a direct hash interface as you have to use the CHI. Lauren C. wrote: Do you know how to tie a hash to a disk file thus read by another process? Currently my solution is writing the data to a JSON file and read it from the other program. Thank you. -- B

Re: tie a hash to a file

2018-08-01 Thread Shlomi Fish
On Wed, 01 Aug 2018 19:16:54 +0800 "Lauren C." wrote: > Do you know how to tie a hash to a disk file thus read by another process? > > Currently my solution is writing the data to a JSON file and read it from the > other program. > > Thank you. > See http://per

Re: tie a hash to a file

2018-08-01 Thread Илья Рассадин
Hi! Look at https://metacpan.org/pod/Tie::File::AsHash On 8/1/18 2:16 PM, Lauren C. wrote: Do you know how to tie a hash to a disk file thus read by another process? Currently my solution is writing the data to a JSON file and read it from the other program. Thank you. -- To unsubscribe

tie a hash to a file

2018-08-01 Thread Lauren C.
Do you know how to tie a hash to a disk file thus read by another process? Currently my solution is writing the data to a JSON file and read it from the other program. Thank you.

Re: Strange HASH(0x2ced735) values

2017-02-22 Thread Superior Shelving
ething is > putting a hash reference in there that shouldn't be doing it. Thanks Uri, but that’s the problem - so far I haven’t been able to tell where it’s being generated. That’s why I was hoping to decode that value. Looks like I’ll have to continue searching. :\ Fra

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread SSC_perl
> On Feb 21, 2017, at 2:34 PM, Sam wrote: > > One can also turn on the DBI trace log as well. Thanks, Sam! That helped a lot. Now I know which subs are involved in creating the SQL so I’m much closer to tracking this down. This is why they say that two heads are better than o

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread Sam
then you can dump the call stack (with caller()) or do other debugging. something is putting a hash reference in there that shouldn't be doing it. Thanks Uri, but that’s the problem - so far I haven’t been able to tell where it’s being generated. That’s why I was hoping to decode

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread Uri Guttman
then you can dump the call stack (with caller()) or do other debugging. something is putting a hash reference in there that shouldn't be doing it. Thanks Uri, but that’s the problem - so far I haven’t been able to tell where it’s being generated. That’s why I was hoping to decode

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread David Precious
> a blank. then you can dump the call stack (with caller()) or do > > other debugging. something is putting a hash reference in there > > that shouldn't be doing it. > > Thanks Uri, but that’s the problem - so far I haven’t been > able to tell where it’s being gene

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread SSC_perl
ething is > putting a hash reference in there that shouldn't be doing it. Thanks Uri, but that’s the problem - so far I haven’t been able to tell where it’s being generated. That’s why I was hoping to decode that value. Looks like I’ll have to continue searching. :\ Fra

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread Uri Guttman
HASH(0x2ced735). that value is a hash reference converted to a string. the number is the actual memory address of that hash and is meaningless at this point if the program is finished (likely since you are looking at the db much later). I take it from what little information I could

Strange HASH(0x2ced735) values

2017-02-21 Thread SSC_perl
In a MySQL db I have a `customers` table with a field called `hide`. There are some strange values that I’d like to know where they’re coming from. In most records `hide` is blank, some others have the value ‘1’, but a handful have values like HASH(0x2ced735). I take it from

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-15 Thread Shlomi Fish
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

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
it $way3 = $confused->[0]{Id}[1]; print $_, "\n" for $way1, $way2, $way3; # okay, let’s pretend you want all the ids @ids = @{ $confused->[0]{Id} }; print $_, “\n” for @ids; The first thing to realize is that data structure (hash/array) references, or any kind of reference for th

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
it $way3 = $confused->[0]{Id}[1]; print $_, "\n" for $way1, $way2, $way3; # okay, let’s pretend you want all the ids @ids = @{ $confused->[0]{Id} }; print $_, “\n” for @ids; The first thing to realize is that data structure (hash/array) references, or any kind of reference for th

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Aaron Wells
way to do it $way2 = $confused->[0]->{Id}->[0]; # an even cleaner way to do it $way3 = $confused->[0]{Id}[1]; print $_, "\n" for $way1, $way2, $way3; # okay, let’s pretend you want all the ids @ids = @{ $confused->[0]{Id} }; print $_, “\n” for @ids; The first thing to

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Shlomi Fish
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', >

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
;>'Id' => [ >>'01tC003udXAIAY', >>'01tC003udXAIAY' >> ], >>'type' => 'Product2' >>

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
;>'Id' => [ >>'01tC003udXAIAY', >>'01tC003udXAIAY' >> ], >>'type' => 'Product2' >>

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
'type' => 'Product2' >> }, 'sObject' ) >> ]; >> >> So if the data structure is contained in a Perl variable called >> $data, then I think that this is a reference to a hash. >> >> So

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Lawrence Statton
'01tC003udXAIAY', '01tC003udXAIAY' ], 'type' => 'Product2' }, 'sObject' ) ]; So if the data structure is contained in a Perl variable called

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Ken Slater
; > So if the data structure is contained in a Perl variable called > $data, then I think that this is a reference to a hash. > > So I need to do something like "@{$data}" to get to the hash. > > But I want the "Id" element of the hash so I want something li

How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
'01tC003udXAIAY' ], 'type' => 'Product2' }, 'sObject' ) ]; So if the data structure is contained in a Perl variable called $data, then I think that this is a reference to a hash. So I ne

Re: Hash in file Formats

2015-12-16 Thread perl kamal
On Thu, Dec 17, 2015 at 1:08 AM, perl kamal wrote: >> >>> Hi, >>> >>> I am trying to read a json output file,capture the required information, >>> storing them in an array and format the output in a file. >>> Please review my code and suggest me i

Re: Hash in file Formats

2015-12-16 Thread Raj Barath
trying to read a json output file,capture the required information, storing them in an array and format the output in a file. Please review my code and suggest me is there any way to construct the hash data structure and use them in the file format. Instead of this (shift @Data_Sources||'&

Re: Hash in file Formats

2015-12-16 Thread Raj Barath
trying to read a json output file,capture the required information, storing them in an array and format the output in a file. Please review my code and suggest me is there any way to construct the hash data structure and use them in the file format. Instead of this (shift @Data_Sources||'&

Re: Hash in file Formats

2015-12-16 Thread perl kamal
++Subject & Thanks. On Thu, Dec 17, 2015 at 1:08 AM, perl kamal wrote: > Hi, > > I am trying to read a json output file,capture the required information, > storing them in an array and format the output in a file. > Please review my code and suggest me is there any way to c

Re: How to interpolate a hash in a string

2015-11-04 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Thank you all for your replies. I was able to do what i needed. I changed a bit the conf files syntax: conf file 1: option=value option2=value2 conf file 2: property=propertyValue property2=propertyValue2 property3=${option2} #instead of $OPTS

Re: How to interpolate a hash in a string

2015-11-03 Thread Jim Gibson
> On Nov 3, 2015, at 2:03 PM, David Emanuel da Costa Santiago > wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > > Hello all. > > I'm trying to interpolate a hash value in a string but i got stuck. > I already tried with eval, without

How to interpolate a hash in a string

2015-11-03 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hello all. I'm trying to interpolate a hash value in a string but i got stuck. I already tried with eval, without any success... I have two conf files in the form conf file 1: option=value option2=value2 conf file 2: property=property

Re: access hash in specific sequence

2015-09-04 Thread Gary Stainburn
er, I decided to go with a variant of Slomi's method. The down side to working this way is that I have to manually maintain the SEQ field, and if I need to add a row in the middle, all subsequent rows need amending. Also, changing back from an array of hashes to hash of hashes meant lots of

Re: access hash in specific sequence

2015-09-03 Thread Uri Guttman
On 09/03/2015 04:50 PM, Marius Gavrilescu wrote: gary.stainb...@ringways.co.uk (Gary Stainburn) writes: On Thursday 03 September 2015 18:19:57 Marius Gavrilescu wrote: The above can be shortened using the Sort::Key module. use Sort::Key 'nkeysort'; for my $key (nkeysort { $pagetype

Re: access hash in specific sequence

2015-09-03 Thread Marius Gavrilescu
gary.stainb...@ringways.co.uk (Gary Stainburn) writes: > On Thursday 03 September 2015 18:19:57 Marius Gavrilescu wrote: >> The above can be shortened using the Sort::Key module. >> >> use Sort::Key 'nkeysort'; >> for my $key (nkeysort { $pagetypes{$_} } keys %pagetypes) { >> # do

Re: access hash in specific sequence

2015-09-03 Thread Gary Stainburn
On Thursday 03 September 2015 18:19:57 Marius Gavrilescu wrote: > gary.stainb...@ringways.co.uk (Gary Stainburn) writes: > > I am aware that you cannot define a key sequence when defining a hash. > > However, if I create a sequence field > > > > my %pagetypes=( > >

Re: access hash in specific sequence

2015-09-03 Thread Charles DeRykus
On Thu, Sep 3, 2015 at 9:42 AM, Gary Stainburn wrote: > I have a hash of hashes which I converted to an array of hashes because I > needed to access them in a specific sequence. It now looks like > > my @pagetypes=( > {'pagetype'=>'Delivery Note',

Re: access hash in specific sequence

2015-09-03 Thread Shawn H Corey
On Thu, 3 Sep 2015 17:42:48 +0100 Gary Stainburn wrote: > I have a hash of hashes which I converted to an array of hashes > because I needed to access them in a specific sequence. It now looks > like > > my @pagetypes=( > {'pagetype'=>'Delivery Note&#

Re: access hash in specific sequence

2015-09-03 Thread Marius Gavrilescu
gary.stainb...@ringways.co.uk (Gary Stainburn) writes: > I am aware that you cannot define a key sequence when defining a hash. > However, if I create a sequence field > > my %pagetypes=( > 'Delivery Note'=>{'seq'=>1,weight'=>2,...

Re: access hash in specific sequence

2015-09-03 Thread Shlomi Fish
Hi Gary, please reply to all recipients. On Thu, 3 Sep 2015 17:42:48 +0100 Gary Stainburn wrote: > I have a hash of hashes which I converted to an array of hashes because I > needed to access them in a specific sequence. It now looks like > > my @pagetypes=( > {'

access hash in specific sequence

2015-09-03 Thread Gary Stainburn
I have a hash of hashes which I converted to an array of hashes because I needed to access them in a specific sequence. It now looks like my @pagetypes=( {'pagetype'=>'Delivery Note','weight'=>2,. {'pagetype'=>'Sales Inv

Re: Perl hash

2015-07-31 Thread bikram behera
Thanks Shlomi. On Fri, Jul 31, 2015 at 3:36 PM, Shlomi Fish wrote: > On Fri, 31 Jul 2015 09:08:06 +0530 > bikram behera wrote: > > > Hi Team, > > > > Please send me hash uses and concept > > > > Please see http://perl-begin.org/topics/hashes/ an

Re: Perl hash

2015-07-31 Thread Shlomi Fish
On Fri, 31 Jul 2015 09:08:06 +0530 bikram behera wrote: > Hi Team, > > Please send me hash uses and concept > Please see http://perl-begin.org/topics/hashes/ and especially "The Hash Cookbook" link. Regards, Shlomi Fish

Re: Perl hash

2015-07-31 Thread Andrew Solomon
One other thing - if you're familiar with other programming languages you may have come across the idea of hash with a different name such as 'associative array', 'dictionary', 'map' or 'symbol table' https://en.wikipedia.org/wiki/Associative_ar

Re: Perl hash

2015-07-31 Thread Martin Barth
om one thing to another and More. > > On Fri, Jul 31, 2015 at 9:15 AM, Uri Guttman wrote: > >> On 07/30/2015 11:38 PM, bikram behera wrote: >> >>> Hi Team, >>> >>> hi, >> we aren't a team. this is a public mailing list. >> >&

Re: Perl hash

2015-07-30 Thread Uday Vernekar
PM, bikram behera wrote: > >> Hi Team, >> >> hi, > > we aren't a team. this is a public mailing list. > > Please send me hash uses and concept >> > > think of them as arrays but instead of integers for indexing, you use > strings. the uses are too man

Re: Perl hash

2015-07-30 Thread Uri Guttman
On 07/30/2015 11:38 PM, bikram behera wrote: Hi Team, hi, we aren't a team. this is a public mailing list. Please send me hash uses and concept think of them as arrays but instead of integers for indexing, you use strings. the uses are too many to list here. some are data struc

Perl hash

2015-07-30 Thread bikram behera
Hi Team, Please send me hash uses and concept Thanks, Bikram

Re: Display a hash in the order of an array

2015-07-21 Thread Vincent Lequertier
ash', map { ( $_,[ ] ) } @ip ); while ( my($key,$value) = each %hash ) { push @{$ordered{$value->{ip}}}, {$key, $value}; } #print Dumper \%ordered; my $i = 1; for my $key (keys %ordered) { print "ip number $i : $key\n"; for my $entry (@{$ordered{$key}}) {

Re: Display a hash in the order of an array

2015-07-20 Thread Charles DeRykus
lement with print > $ordered{'xxx.xxx.xxx.xxx'}[0]{'[15/Jul/2015:10:30:03 +0200]'}{action}; > > But I don't find how to get the dates e.g. '[15/Jul/2015:10:30:03 +0200]' > > Here is what I've tried: > > tie( my %ordered, '

Re: Display a hash in the order of an array

2015-07-20 Thread Vincent Lequertier
/2015:10:30:03 +0200]'}{action}; But I don't find how to get the dates e.g. '[15/Jul/2015:10:30:03 +0200]' Here is what I've tried: tie( my %ordered, 'Tie::IxHash', map { ( $_,[ ] ) } @ip ); while ( my($key,$value) = each %hash ) { push @{$ordered{$value-&g

Re: Display a hash in the order of an array

2015-07-20 Thread nosettle
> Hi, > > I have the following structure : > > $hash{$date} = { > 'ip' => $ip, > 'action' => $action, > }; > > witch produce data like : > > $VAR1

Re: Display a hash in the order of an array

2015-07-20 Thread Vincent Lequertier
Thank you, I thought about transforming my hash like your function transform_date_logs_to_ip_logs does but didn't found the way. I'm now trying to understand exactly how that works :-) -- Vincent Lequertier vincentlequertier.tk Le 2015-07-17 16:40, Brandon McCaig a écrit : Vincen

Re: Display a hash in the order of an array

2015-07-20 Thread Shlomi Fish
Hi Vincent, On Mon, 20 Jul 2015 09:18:33 +0200 Vincent Lequertier wrote: > Thank you for the help, but this does not work. We needa pass the ip > addresses to the sorting function, because actually the keys of the hash > are the dates > > $VAR1 = '[15/Jul/2015:10:30

Re: Display a hash in the order of an array

2015-07-20 Thread Илья Рассадин
Why you don't want rebuild you hash into another hash with ip address as a key? Yes, it will cost you additional memory and runtime but it will be more convenient and easy to understand, support and modificate. If memory is not a problem, i think it's best choice in your case.

Re: Display a hash in the order of an array

2015-07-20 Thread Vincent Lequertier
Thank you for the help, but this does not work. We needa pass the ip addresses to the sorting function, because actually the keys of the hash are the dates $VAR1 = '[15/Jul/2015:10:30:03 +0200]'; $VAR2 = { 'ip' => 'xxx.xxx.xxx.xxx'

Re: Display a hash in the order of an array

2015-07-17 Thread Charles DeRykus
Another approach using Tie::IxHash: use Tie::IxHash; use Data::Dumper; use feature 'say'; my @ip = (...) my %hash = (...); tie( my %ordered, 'Tie::IxHash', map { ( $_,[ ] ) } @ip ); while ( my($key,$value) = each %hash ) { push @{$ordered{$value->{ip}}}, {$ke

Re: Display a hash in the order of an array

2015-07-17 Thread Brandon McCaig
On Fri, Jul 17, 2015 at 10:40 AM, Brandon McCaig wrote: > for my $i (0..4) { Errr, 0..3. >_> Regards, -- Brandon McCaig Castopulence Software Blog perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }. q{Vg qbrfa'\''g nyjnlf fbhaq gung

Re: Display a hash in the order of an array

2015-07-17 Thread Brandon McCaig
Vincent: On Fri, Jul 17, 2015 at 9:11 AM, Vincent Lequertier wrote: > Hi, Hello, > I have the following structure : > > $hash{$date} = { > 'ip' => $ip, > 'action' => $action, > }; >

Re: Display a hash in the order of an array

2015-07-17 Thread Shawn H Corey
On Fri, 17 Jul 2015 15:11:13 +0200 Vincent Lequertier wrote: > Hi, > > I have the following structure : > > $hash{$date} = { > 'ip' => $ip, > 'action' => $action, > }; > >

Display a hash in the order of an array

2015-07-17 Thread Vincent Lequertier
Hi, I have the following structure : $hash{$date} = { 'ip' => $ip, 'action' => $action, }; witch produce data like : $VAR1 = '[15/Jul/2015:10:30:03 +0200]'; $VAR2 = { 'ip

Re: using hash_value from Hash::Util

2015-07-08 Thread Kent Fredric
me/kent/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/x86_64-linux/Hash/Util.pm - 2 NO: /home/kent/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Hash/Util.pm - 3 YES: /home/kent/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/Hash/Util.pm => version 0.18 - 4 NO: /home/kent/perl

AW: using hash_value from Hash::Util

2015-07-08 Thread Nagy Tamas (TVI-GmbH)
Hi, Documentation says it is available in PERL 5. 22. http://perldoc.perl.org/Hash/Util.html Is it a documentation mistake? Tamas -Ursprüngliche Nachricht- Von: Kent Fredric [mailto:kentfred...@gmail.com] Gesendet: Mittwoch, 8. Juli 2015 13:00 An: Nagy Tamas (TVI-GmbH) Cc: beginners

Re: using hash_value from Hash::Util

2015-07-08 Thread Kent Fredric
On 8 July 2015 at 23:00, Kent Fredric wrote: > impervious to accidentally typing trailing spaces inside the quotes: Ugh. I forgot to note: you can read on these "operators" in : perldoc -f qw perldoc perlop # search for "Quote-Like" -- Kent KENTNL - https://metacpan.org/author/KENTNL --

Re: using hash_value from Hash::Util

2015-07-08 Thread Kent Fredric
On 8 July 2015 at 21:51, Nagy Tamas (TVI-GmbH) wrote: > > > "hash_value" is not exported by the Hash::Util module > > "bucket_stats" is not exported by the Hash::Util module > > "bucket_info" is not exported by the Hash::Util module > >

using hash_value from Hash::Util

2015-07-08 Thread Nagy Tamas (TVI-GmbH)
Hi, As I include: 1. use<http://perldoc.perl.org/functions/use.html> Hash::Util qw( 2. fieldhash fieldhashes 3. 4. all_keys 5. lock_keys unlock_keys 6. lock_value unlock_value 7. lock_hash unlock_hash 8. lock_keys_plus 9. hash_locked hash_unlocked 10.hashref_locked hashref_unloc

Re: Perl Hash concept.

2015-07-03 Thread Kent Fredric
On 3 July 2015 at 18:54, bikram behera wrote: > Hi Team, > > > Any body can explain me how to do perl hash refernce and dereference. > Create a hash: my (%hash) = ( "key" => "value" , "otherkey" => "othervalue" ); Create a referenc

Perl Hash concept.

2015-07-02 Thread bikram behera
Hi Team, Any body can explain me how to do perl hash refernce and dereference. Thanks, Bikram

Re: help with Hash of arrays of arrays

2015-07-02 Thread Илья Рассадин
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

Re: help with Hash of arrays of arrays

2015-07-02 Thread 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 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

Re: help with Hash of arrays of arrays

2015-07-01 Thread Shlomi Fish
Hi Nat, some comments about your code. On Wed, 1 Jul 2015 13:00:53 +0100 nco...@ebi.ac.uk wrote: > Hi, > I need some help with a hash of array of array. > this is my input data structure: > gene aal1 data1 data2 data9 > gene bal2 data3 data4

help with Hash of arrays of arrays

2015-07-01 Thread nconte
Hi, I need some help with a hash of array of array. this is my input data structure: gene a al1 data1 data2 data9 gene b al2 data3 data4 data10 gene b al3 data5 data6 data12 gene b al4 data7 data8 data12 I take each data variable, see above, from a sql query

Re: want to access single value in a hash

2015-06-18 Thread Balasubramanian Duraisamy
hu, Jun 18, 2015 at 10:26 AM, Sunita Pradhan < > sunita.pradhan.2...@hotmail.com> wrote: > >> Yeah I am able to access the value but how to get the key ? >> >> -Sunita >> >> ------ >> From: akshaymohit2...@gmail.com >> Date:

Re: want to access single value in a hash

2015-06-18 Thread Andrew Solomon
> From: akshaymohit2...@gmail.com > Date: Thu, 18 Jun 2015 14:46:10 +0530 > Subject: Re: want to access single value in a hash > To: sunita.pradhan.2...@hotmail.com > CC: beginners@perl.org > > > Try this:- > print > "$cmd_param_show->{'scsitrace_start_l

RE: want to access single value in a hash

2015-06-18 Thread Sunita Pradhan
Yeah I am able to access the value but how to get the key ? -Sunita From: akshaymohit2...@gmail.com Date: Thu, 18 Jun 2015 14:46:10 +0530 Subject: Re: want to access single value in a hash To: sunita.pradhan.2...@hotmail.com CC: beginners@perl.org Try this:-print "$cmd_param

Re: want to access single value in a hash

2015-06-18 Thread Akshay Mohit
#x27; => 16, > 'max-file-size' => 0}}, >'scsitrace_dump' => > {'param_val'=>{}, > 'scsitrace_show' => {'log-to-disk'=> 'false', > 'enabled'=> 'false', > 'max-chain-size' => 16, > 'max-file-size' => 0}}, >}; > > How can I access single value from this hash without using loop ? > > I tried to print like : > print > "%{$cmd_param_show}->{'scsitrace_start_log_to_disk_true'}->{'param_val'}\n"; > > It failed . > Please help me to get this. > > Thanks > Sunita >

want to access single value in a hash

2015-06-18 Thread Sunita Pradhan
; => 0}}, 'scsitrace_dump' => {'param_val'=>{}, 'scsitrace_show' => {'log-to-disk' => 'false','enabled'=> 'false','max-chain-size' => 16, 'max-file-size' => 0}}, }; How can I access single value from this hash without using loop ? I tried to print like :print "%{$cmd_param_show}->{'scsitrace_start_log_to_disk_true'}->{'param_val'}\n"; It failed .Please help me to get this. ThanksSunita

Re: Changing the structure of a hash

2015-06-17 Thread Anirban Adhikary
Hi All I made a simple solution would like to share with all. also forget to share that every array would have 16 entries, considering my previous hash name is %MAIO_CH_GROUP my @total_array; foreach my $key (sort keys %MAIO_CH_GROUP) { print "KEY=[$key]--VALUE=[@{$MAIO_CH_GROUP

Re: Changing the structure of a hash

2015-06-17 Thread Jim Gibson
It seems that you are working with a two-dimensional array of numbers, so it is not clear why you are using a hash to store this data instead of an array of arrays. What you seem to be asking for is to generate the transpose of the two-dimensional array. So the simplest approach would be to

Changing the structure of a hash

2015-06-17 Thread Anirban Adhikary
Hi List I have a hash with the following data structure. KEY=[0]-- VALUE=[57 147 237 327 417 507 597 687 777 867 957 1047 1137 1227 1317 1407] KEY=[1]-- VALUE=[58 148 238 328 418 508 598 688 778 868 958 1048 1138 1228 1318 1408] KEY=[10]--VALUE=[67 157 247 337 427 517 607 697 787 877 967 1057

Re: Bizarre copy of HASH in list assignment...

2015-04-12 Thread Manfred Lotz
... I just worked around by using warn/die again. -- Manfred On Tue, 31 Mar 2015 13:24:31 +0300 Shlomi Fish wrote: > Hi Manfred, > > On Tue, 31 Mar 2015 10:28:13 +0200 > Manfred Lotz wrote: > > > Hi there, > > I have a script where I use croak and somebody else using

Re: Bizarre copy of HASH in list assignment...

2015-03-31 Thread Andy Bach
On Tue, Mar 31, 2015 at 3:28 AM, Manfred Lotz wrote: > > Bizarre copy of HASH in list assignment > at /usr/share/perl/5.20/Carp.pm line 228. > Hmm: http://stackoverflow.com/questions/6217317/bizarre-copy-of-unknown-in-subroutine-entry which suggests: A "Bizarre copy" oc

Re: Bizarre copy of HASH in list assignment...

2015-03-31 Thread Shlomi Fish
Hi Manfred, On Tue, 31 Mar 2015 10:28:13 +0200 Manfred Lotz wrote: > Hi there, > I have a script where I use croak and somebody else using that script > gets > > Bizarre copy of HASH in list assignment > at /usr/share/perl/5.20/Carp.pm line 228. > > I get a me

Bizarre copy of HASH in list assignment...

2015-03-31 Thread Manfred Lotz
Hi there, I have a script where I use croak and somebody else using that script gets Bizarre copy of HASH in list assignment at /usr/share/perl/5.20/Carp.pm line 228. I get a message like this, instead: Variable b has empty value! at ./x.pl line 23. main::myfunc() called at ./x.pl line

RE: reading a hash of arrays

2014-11-19 Thread Frank K.
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

Re: reading a hash of arrays

2014-11-19 Thread Shawn H Corey
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 --

reading a hash of arrays

2014-11-19 Thread Frank K.
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&

RE: Creating a hash of arrays from

2014-07-10 Thread Sunita Pradhan
You can try using a reference instead of hash like : -- my $entries; my($state, $zipcodes); while (my $line = ) { chomp $line; ($state, $zipcodes) = split (/=/, $line); push( @{ $entries->{$state} }, split( /,/,$zipcodes) ) } print Dumper ($entries); __DATA__

Re: Creating a hash of arrays from

2014-07-10 Thread SSC_perl
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

Re: Creating a hash of arrays from

2014-07-10 Thread Ron Bergin
strict; > use warnings; > use Data::Dumper; > > my %entries; > > while (my $line = ) { > chomp $line; > my($state, @zipcodes) = split /[=,]/, $line; > push @{ $entries{$state} }, \@zipcodes; I kept your original hash data structure, but in this case

Re: Creating a hash of arrays from

2014-07-10 Thread Ron Bergin
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;

Re: Creating a hash of arrays from

2014-07-10 Thread Nathan Hilterbrand
and 'split' to populate the hash. Could you explain a little about what the square brackets are for here? Does that have something to do with array ref's? Sorry... hashes are a weak spot of mine. Yes, it does use an array ref. What it says, briefly, is "split $zi

Re: Creating a hash of arrays from

2014-07-10 Thread SSC_perl
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.

Re: Creating a hash of arrays from

2014-07-09 Thread SSC_perl
printout loop. :\ For some reason, I was thinking my problem was in creating the hash. I see what I did wrong now. Thanks again, Frank http://www.surfshopcart.com/ Setting up shop has never been easier! Now on GitHub https://github.com/surfshopcart/surfshop -- To unsubscribe, e-mail: beginne

  1   2   3   4   5   6   7   8   9   10   >