> Please help me!
> I'm going crazy!
For cocoa puffs?
> It's perfect but I need something more.I need also the
> qw001234 with the
> passwd that's in another file in format:
>
> qw001234 rfvcde
>
> And I want it for all lines of all files.
Of ALL files?
> I'm obviously a beginner in perl so I don't know if it is
> possible. Bye and many thanks for your help.
Ok so from the previous posting, we have
> ($pw0,$uid1,$pw1,$uid2,$pw2) = split(/\s+/, $line);
It looks to me like the $pw0 should be $uid0 instead:
> ($uid0,$uid1,$pw1,$uid2,$pw2) = split(/\s+/, $line);
So how about storing all the $uid0's in a hash so we can assign them
passwords later, a la:
%uid0s{$uid0} = ''; # each time through your loop
And later in your program:
open OTHER,"</path/to/other/file"
or die "couldn't open file: $!\n";
while(<OTHER>) {
my ($uid0,$pw0) = split /\s+/;
$uid0s{$uid0} = $pw0 if defined $uid0s{$uid0};
}
close OTHER;
for my $uid0 (keys %uid0s) {
print NEWFILE "$uid0 $uid0s{$uid0} \n";
}
HTH,
-dave
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]