CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
substitute and assign

 



davidmaxwaterma
New User

Nov 27, 2008, 4:09 AM

Post #1 of 2 (311 views)
substitute and assign Can't Post

Hi,

I often find myself doing :


Code
$a = $b; 
$b =~ s/x/y/;


I'd like to do this in one statement, something like this :


Code
$a = $b:s/x/y/


similar to in a shell :


Code
set a=$b:s/x/y/;

or even :

Code
a=${b/x/y}


I'm sure there's a way, but...

Max.


KevinR
Veteran


Nov 27, 2008, 9:57 AM

Post #2 of 2 (306 views)
Re: [davidmaxwaterma] substitute and assign [In reply to] Can't Post

$a = $b =~ s/x/y/;
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives