Hi,
I have question, in my script i have lines as below:
open(PASSFILE, "+>>passfile") || die "Cannot open file: $!\n";
print PASSFILE "$usname[$i] : $pasname[$i]\n";
close(PASSFILE);
and they work fine,
and in the "passfile i have
root : root123
But if i want to read the lines from the passfile how do i do it?
In another perl script i want to verify whether the user is in the file or
not?
../verify root
i want to know how to match the command line argument with the pattern
present in the file.
i know
$user = $ARGV[0];
open(FILE, "passfile) || die "Cannot open file: $!\n";
while(<FILE>) {
what should come here for me to verify whether the user is present in the
passfile of not?
i tried split, grep, but could not find the correct way to put that in the
script.
Thanx for the help!
:wq Prabhu
################################################
Never write it in 'C', if you can do it in 'awk';
Never do it in 'awk', if 'sed' can handle it;
Never use 'sed' when 'tr' can do the job;
Never invoke 'tr' when 'cat' is sufficient;
Avoid using 'cat' whenever possible;
- Laws of programming.
################################################
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]