Re: list to hash puzzle

2014-02-09 Thread shawn wilson
Ugh, best document the hell out of that. Split with parameters, splitting a tr - I see that everywhere... On Feb 9, 2014 6:45 PM, "Bill McCormick" wrote: > On 2/9/2014 10:48 AM, Bill McCormick wrote: > >> Trying to map the array list into a hash, but loose the double quotes >> surrounding the key

Re: list to hash puzzle

2014-02-09 Thread Shawn H Corey
On Sun, 09 Feb 2014 16:29:30 -0600 Bill McCormick wrote: > On 2/9/2014 3:58 PM, Shawn H Corey wrote: > > On Sun, 09 Feb 2014 10:48:46 -0600 > > Bill McCormick wrote: > > > >> Trying to map the array list into a hash, but loose the double > >> quotes surrounding the key's value. > > > > You can c

Re: list to hash puzzle

2014-02-09 Thread Bill McCormick
On 2/9/2014 10:48 AM, Bill McCormick wrote: Trying to map the array list into a hash, but loose the double quotes surrounding the key's value. This is close, but it's not removing the quotes. Solutions? #!/usr/bin/perl -w use strict; use Data::Dumper; my @array = qw(foo1="bar1" foo2="bar2");

Re: list to hash puzzle

2014-02-09 Thread Uri Guttman
On 02/09/2014 05:29 PM, Bill McCormick wrote: On 2/9/2014 3:58 PM, Shawn H Corey wrote: On Sun, 09 Feb 2014 10:48:46 -0600 Bill McCormick wrote: Trying to map the array list into a hash, but loose the double quotes surrounding the key's value. You can convert a list to a hash directly: my

Re: list to hash puzzle

2014-02-09 Thread Andy Bach
On Sun, Feb 9, 2014 at 10:48 AM, Bill McCormick wrote: > Trying to map the array list into a hash, but loose the double quotes > surrounding the key's value. "lose" the quotes, you mean. I think the trouble is your thinking the map will create a list of strings and so the quotes will auto-magic

Re: list to hash puzzle

2014-02-09 Thread Bill McCormick
On 2/9/2014 3:58 PM, Shawn H Corey wrote: On Sun, 09 Feb 2014 10:48:46 -0600 Bill McCormick wrote: Trying to map the array list into a hash, but loose the double quotes surrounding the key's value. You can convert a list to a hash directly: my %hash = qw( foo1 bar1 foo2 bar2 ); Sure, bu

Re: list to hash puzzle

2014-02-09 Thread Shawn H Corey
On Sun, 09 Feb 2014 10:48:46 -0600 Bill McCormick wrote: > Trying to map the array list into a hash, but loose the double quotes > surrounding the key's value. You can convert a list to a hash directly: my %hash = qw( foo1 bar1 foo2 bar2 ); -- Don't stop where the ink does. Shawn

list to hash puzzle

2014-02-09 Thread Bill McCormick
Trying to map the array list into a hash, but loose the double quotes surrounding the key's value. This is close, but it's not removing the quotes. Solutions? #!/usr/bin/perl -w use strict; use Data::Dumper; my @array = qw(foo1="bar1" foo2="bar2"); print "Array:\n"; print Dumper(@array); pr

Re: package block

2014-02-09 Thread Paul Johnson
On Wed, Feb 05, 2014 at 10:51:56AM +0100, Manfred Lotz wrote: > Hi all, > Perl 5.14 allows package blocks. > > Assume i have a file Hello.pm > > package Hello; { > ... > > 1; > } > # or better here > # 1; > > > My question is: Would I put 1; inside the { } or should I put it > outside the