Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: Help with Regular Expressions and Perl

by Punitha (Priest)
on Apr 01, 2010 at 04:45 UTC ( #832202=note: print w/ replies, xml ) Need Help??

in reply to Re: Help with Regular Expressions and Perl
in thread Help with Regular Expressions and Perl


You are processing a single file (reading and writing in the same file), so please check the input file content in every execution (may be you are reading the blank file) or try link this,

use strict; use warnings; open(INFILE, "<perlfile.txt"); my @variable; my $variable = join("\n", @variable = <INFILE>); close(INFILE); open(OUTFILE, ">perlfile_out.txt"); $variable =~ s/0/zero/g ; $variable =~ s/1/one/g ; $variable =~ s/2/two/g ; $variable =~ s/3/three/g ; $variable =~ s/4/four/g ; $variable =~ s/5/five/g ; $variable =~ s/6/six/g ; $variable =~ s/7/seven/g ; $variable =~ s/8/eight/g ; $variable =~ s/9/nine/g ; print OUTFILE "$variable"; close(OUTFILE);


Comment on Re^2: Help with Regular Expressions and Perl
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://832202]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (16)
As of 2015-08-03 13:27 GMT
Find Nodes?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...

    Results (37 votes), past polls