Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Difference between tr// and s///?

by japhy (Canon)
on Feb 06, 2004 at 16:49 UTC ( [id://327138]=note: print w/replies, xml ) Need Help??


in reply to Re: Difference between tr// and s///?
in thread Difference between tr/// and s///?

Your tr/// vs. s/// comparison is very broken. You're using the SAME variable in each iteration. You need to do:
transliterate => sub { (my $x = $todo) =~ tr/+/ / }, substitution => sub { (my $x = $todo) =~ s/\+/ /g }, just_copy => sub { (my $x = $todo) },
_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-19 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found