Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
#!/usr/bin/perl use strict; my @wheel1 = qw( 8 4 6 6 3 3 8 4 ); my @wheel2 = qw( 1 2 4 6 3 8 8 9 5 1 6 1 7 2 8 1 ); print "KEY:"; chomp(my $key = <STDIN>); my @wheel3 = map(ord, split //, $key); my $file = @ARGV[0]; $/ = undef; print "OPENING $file\n"; open(IN, "$file") || die "painful death! (because there is no $file)"; my ($out); my $plaintext = <IN>; close(IN); open(OUT, ">$file"); my @nums = map(ord, split //, $plaintext); foreach (@nums) { print "*"; my $x = @wheel1[0] + @wheel2[0] + @wheel3[0]; if (@ARGV[1] eq "-d") { $out = $_ + $x; } else { $out = $_ - $x; } $out = chr $out; print OUT $out; push @wheel1, shift @wheel1; push @wheel2, shift @wheel2; print "\b"; }

In reply to Ximp by beretboy

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (4)
    As of 2018-08-20 22:34 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Asked to put a square peg in a round hole, I would:









      Results (196 votes). Check out past polls.

      Notices?