If your script is the one generating the log file, it should be as simple as to find the line that writes the password and just replace it with whatever string you want. for example

old line
   print $UN."/".$PW

new line
   print $UN."/XXXXXX"

you get the idea.

If the log is being generated by some other program and you are just processing it, why not just make the substitution before you start processing something like this might do the trick

$ sed s/PASSWORD/XXXXXXXX/g <logfile.in >logfile.out
$ mv logfile.out logfile.in

Rentachintala, Jagan wrote:
Hi,



I am a newbie to perl and I have a question. In one of my project, the perl
script will create a logfile. Inside the log file, the username/password is
in clear text.




I am trying to hide the password in the logfile.  Is there a way that I can
hide the password or put an 'XXXXXX' in the password place in the log file.

How do I do this.



Advance thanks

Jagan Rentachintala | Consultant | Idea Integration | (904) 360-2421 |
<http://www.idea.com/> www.idea.com | (NYSE:
<http://www.mpsgroup.com/investors/stock/fset.asp> MPS)

Idea Integration, An MPS Group Company - IT solutions from the desktop to
the data center.

_____





--

+------------------------------------------
| José J. Cintrón - <[EMAIL PROTECTED]>
+------------------------------------------



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to