Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Help with Regular Expressions and Perl

by kiruthika.bkite (Scribe)
on Apr 01, 2010 at 07:18 UTC ( #832226=note: print w/replies, xml ) Need Help??


in reply to Help with Regular Expressions and Perl

The syntax of join is,
join EXPR,list

I have just modified your code into the following.
use strict; use warnings; my @variable; my $variable; open(INFILE, "<perlfile.txt"); @variable=<INFILE>; $variable =join(" ",@variable); print "$variable"; close(INFILE); open(OUTFILE, ">perlfile.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 "$variable"; print OUTFILE "$variable","\n"; close(OUTFILE);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://832226]
help
Chatterbox?
[marto]: Eily, there's actually a lot of good discussion on the topic in the HN link choroba posted
[marto]: sorry for the late response, busy busy :/
[Corion]: I think you need to load Readline in the debugger, but I don't know how
[Corion]: Yay, invitation for a team-building workshop, with a team of 100 people :-/
[Eily]: marto after an additional read I started to see the light actually. And choroba's link was helpful as well :)
[Corion]: I'll send my colleague who doesn't yet know the people there, and I'll do production duty instead.

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2017-07-26 15:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (396 votes). Check out past polls.