in reply to Re: pulling information from a delineated text file using a subroutine
in thread pulling information from a delineated text file using a subroutine

What happens if you want part number 0 ?

-- Hofmator

  • Comment on Re: Re: pulling information from a delineated text file using a subroutine

Replies are listed 'Best First'.
Re^3: pulling information from a delineated text file using a subroutine
by Coruscate (Sexton) on Jan 17, 2003 at 00:24 UTC

    I didn't really consider this option as I suppose I would never assign a product to ID 0. Zero isn't really a number, therefore why would I assign a product to a not-really-a-number ID? :P

    Anyway, if you really did need part 0, then just change while (!$part || $part =~ /[^0-9]/) { to while (!defined $part || $part =~ /[^0-9]/) {. The only thing this will also change is if the user hits enter without entering anything, the program will exit. That's fine by my standards