On Sun, 09 Feb 2014 16:29:30 -0600
Bill McCormick <wpmccorm...@gmail.com> wrote:

> On 2/9/2014 3:58 PM, Shawn H Corey wrote:
> > On Sun, 09 Feb 2014 10:48:46 -0600
> > Bill McCormick <wpmccorm...@gmail.com> 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, but that doesn't strip the " and = from this:
> 
> my @hash = qw(foo1="bar1" foo2="bar2");

Are you getting these values from data or are hard-written into your
code? If they're embedded in your code, don't make more work for
yourself.

my %hash = qw(
    foo1    bar1
    foo2    bar2
);


-- 
Don't stop where the ink does.
        Shawn

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to