hey monks,
I was messing around with FILEHANDLE and tr/ / / earlier today and came up with this little script just for practice:
#! /usr/bin/perl print 'Enter path of file: '; chomp($path = <>); open(FH,"$path") || die "$!\n"; while (<FH>){ $_=~ tr/a-zA-Z/0-310/; print " $_\n";}
What I really wanted to do here was to add a few more lines of code that would make perl create a new file in the same directory and prompt me to enter the new name of the file but to not overwrite the file I opened above. I was looking around and do believe that I need to add:
use cwd; $dir = getcwd; #etc.. print 'Enter new file name: ';
I am looking around perlmonks and all that I have been able to come up with so far are:
Node#183899
and
mkpath()
but I am unsure if whether or not these pages will suffice for what I am trying to do.

"Es gibt mehr zu Leben als Bücher, kennen Sie. Aber nicht viel mehr " -(Der Smiths)

In reply to Take file A , translate it, place in new file by sub_chick

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.