Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Substitution all parts of an array...

by CukiMnstr (Deacon)
on Mar 14, 2003 at 08:21 UTC ( #242978=note: print w/replies, xml ) Need Help??


in reply to Re: Substitution all parts of an array...
in thread Substitution all parts of an array...

while (<IN>) { chomp; $_ =~ s/://g; print OUT $_ ."\n"; }

you can get rid of the chomp; and then you don't need to append "\n" when printing.

in the second option, iterating twice on the data (once for reading the file and then another time for the substitution) can get pretty inefficient if the file is big.

just my 2 cents.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2020-02-17 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (71 votes). Check out past polls.

    Notices?