in reply to Print hash value even if it's zero

You'll want to use printf so that you can specify a format string.

printf STDOUT "%d|", ($val);
will do the trick (note the brackets). The %d specifies that you want to print an integer, similarly %s is a string, %f a floating point value, etc.

See perlfunc for more details.

Hope this helps, -gjb-

Replies are listed 'Best First'.
Re: Re: Print hash value even if it's zero
by fglock (Vicar) on Nov 19, 2002 at 13:43 UTC

    You can also try

    print 0 + $val;