Re: Something screwy with split

2003-06-20 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > This works but does anyone have any ideas on the previous question? > while( ) >{ >$line=$_; >chomp($line); >@list=split(/:/,$line); >$account_key=$list[0]; >$account=join ":",@list; >$record{$account_key}=$acc

Re: Something screwy with split

2003-06-14 Thread Harry Putnam
"Rob Dixon" <[EMAIL PROTECTED]> writes: > open PWD, '/etc/passwd' or die $!; > > next line, anybody? while (){ hehe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Something screwy with split

2003-06-14 Thread Rob Dixon
Royce Wells wrote: > I am trying to split off the user name and the password record in one pass > through however what I am getting is only the first record is being > populated into my user array. > > Can someone tell me am I going about this the right way? > > Thanks, > Royce > > > > my @user=(sp

Re: Something screwy with split

2003-06-13 Thread Steve Grazzini
On Fri, Jun 13, 2003 at 12:28:47PM -0500, James Edward Gray II wrote: > On Friday, June 13, 2003, at 12:01 PM, [EMAIL PROTECTED] wrote: > > >my @user=(split(/:/,(@passwd=(split(/\n/,`cat /etc/passwd`)))[0])); > > I'm not 100% sure how your /etc/passwd is formatted, but if the name is > before t

Re: Something screwy with split

2003-06-13 Thread James Edward Gray II
On Friday, June 13, 2003, at 12:54 PM, [EMAIL PROTECTED] wrote: password file format user:passwd:uid:gid:gecos:homedir:shell I need to be able to change any of the fields within each user record. While having the hash key remain the same user across many files. I'm not sure I understand the que

Re: Something screwy with split

2003-06-13 Thread John W. Krahn
Royce Wells wrote: > > I am trying to split off the user name and the password record in one pass > through however what I am getting is only the first record is being > populated into my user array. > > Can someone tell me am I going about this the right way? You should probably use perl's buil

Re: Something screwy with split

2003-06-13 Thread Casey West
It was Friday, June 13, 2003 when [EMAIL PROTECTED] took the soap box, saying: : Can someone tell me am I going about this the right way? : : my @user=(split(/:/,(@passwd=(split(/\n/,`cat /etc/passwd`)))[0])); : for($i=0;$i <= $#passwd ; $i++) : { : print "$user[$i]\n"; : print "$passwd[$i]\n"; :

Re: Something screwy with split

2003-06-13 Thread James Edward Gray II
On Friday, June 13, 2003, at 12:01 PM, [EMAIL PROTECTED] wrote: I am trying to split off the user name and the password record in one pass through however what I am getting is only the first record is being populated into my user array. Can someone tell me am I going about this the right way? H