in reply to no good a chomping

You have a false impression of chomp from the looks of it. What it does is destructively removing trailing whitespace from a string, whereas you appear to be using it to split and initialise two variables. I imagine you'll want something more like this
#!/usr/bin/perl open USRS, "users" or die "can't open file: $!"; while(<USRS>) { chomp; my($user, $pass) = split ':'; # do stuff with $user and $pass } close USRS;
That loops through the file, dropping any trailing whitespace (e.g a newline), then splits on the colon and assigns the left side of the colon to $user and the right side to $pass (the code assumes that your data will only ever look like user:pass). See. split for more info on splitting a string.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: no good a chomping
by Skeeve (Parson) on Jun 13, 2003 at 12:03 UTC
    What it does is destructively removing trailing whitespace from a string

    If I'm not completely wrong, chomp removes a \n from the end of a string and not all the whitespace.

      <Pedant_alert> chomp removes the current value of $/ from the end of the string. </Pedant_alert>