in reply to Re: list values of specific hash keys
in thread list values of specific hash keys

Hi Thanks for the answer. When I run my script i get an error: Use of uninitialized value @hash[0] in print. Same error with your piece of code. I'm trying to print the value to test if I'm on track. \Sorenjul

Replies are listed 'Best First'.
Re^3: list values of specific hash keys
by chromatic (Archbishop) on Feb 27, 2012 at 21:19 UTC

    @hash[0] is a single-element array slice. You'll probably have to post more code, but that looks wrong to me.


    Improve your skills with Modern Perl: the free book.

Re^3: list values of specific hash keys
by JavaFan (Canon) on Feb 27, 2012 at 21:41 UTC
    You don't have a print statement in the snippet you post.

    Please, to avoid having people to guess what's wrong with your code, post the right code, the error message you are getting, and anything else that's necessary to reproduce your problem.

    Really, if your error is at a print statement, and neither your code snippet nor your description mentions this, you're just wasting everyones time.

      Hi

      Sorry for not being clear about the print, but the issue was that I could not generate the combined string and the way I tested it was with print. I think I solve part of the problem by chomp'ing $key before using it and declaring all variables outside the loop.

      \Sorenjul