sub_chick has asked for the wisdom of the Perl Monks concerning the following question:
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:#! /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";}
I am looking around perlmonks and all that I have been able to come up with so far are:use cwd; $dir = getcwd; #etc.. print 'Enter new file name: ';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Take file A , translate it, place in new file
by GrandFather (Saint) on Dec 12, 2005 at 18:52 UTC | |
by sub_chick (Hermit) on Dec 12, 2005 at 23:05 UTC | |
|
Re: Take file A , translate it, place in new file
by davidrw (Prior) on Dec 12, 2005 at 18:57 UTC | |
|
Re: Take file A , translate it, place in new file
by InfiniteSilence (Curate) on Dec 12, 2005 at 19:07 UTC | |
|
Re: Take file A , translate it, place in new file
by graff (Chancellor) on Dec 13, 2005 at 02:56 UTC |