On 2014-02-09 17:48, Bill McCormick wrote:
Trying to map the array list into a hash, but loose the double quotes
surrounding the key's value.
Or do str-to-hash:
perl -Mstrict -MData::Dumper -wE'
my $str = q(foo1="bar1" foo2="bar2");
my $re_kv = qr/\s*(\S+)\s*=\s*"([^"]*)"/;
my %hash
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
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
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");
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
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
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
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