Greetings, I am inquring as to the semantics of a gracefull completeion to this script.Also, how would I bumm this down to OO? ..apending: this request for help getting the code here where it should be Thanks monks...
#! /usr/bin/perl our $username; our $name; our $passwd; our $password; our $rot; print ":::this is passwd stickum:::\n"; print "to recover and hide passwords\n"; print "---press any key to begin---\n"; if (<STDIN>){&user}; sub user{ print "Account name:\n"; while (<>){ $username=$_; chomp $username; &query; } sub query{ print "Restore saved?\n"; while (<>){ my $mode=$_; if ($mode=~/yes|y/){ &recordsread; } elsif($mode=~/no|n/){ &recordswrite; } } } sub recordsread{ open(PASSWD, "+</.stickum.txt"); LINE:while (<PASSWD>){ $/="\n"; ($name, $passwrd)=split (/:/); next LINE if($name ne $username); feistal($passwrd); } print "The plaintext is:$rot\n"; close PASSWD; } sub recordswrite{ print "What is the new password?\n"; $passwd=<STDIN>; feistal($password); open (PASSWD "+</.stickum.txt"); EXISITS: while (<PASSWD>){ $\="/n"; $line=$_; next EXISTS unless $line=undef; } print PASSWD "$username:$rot"; close PASSWD; print "Recorded, go ahead and forget\n"; } sub feistal{ $rot=shift@_; $rot=~tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/; return $rot; }

edited: Mon Jun 21 17:58:39 2004 by jeffa - pasted code from user's scratchpad ...


In reply to Gracefull completion.. by dReKurCe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.