Perl Monk, Perl Meditation | |
PerlMonks |
s/// operator and bindingby ibanix (Hermit) |
on Jan 28, 2003 at 00:13 UTC ( [id://230416]=perlquestion: print w/replies, xml ) | Need Help?? |
ibanix has asked for the wisdom of the Perl Monks concerning the following question:
Hi fellow monks, How do I do a substitute on a variable and assign it to a another variable, w/o actually editing the first variable? This is what I've been trying but this returns "1" into $path; which is suppose is the return value of the s/$ref_srv/$server/i operation. I'll be reading perldoc, but perhaps someone will have a quicker/better/shorter way to do this. Thanks, ibanix $ echo '$0 & $0 &' > foo; chmod a+x foo; foo;
Back to
Seekers of Perl Wisdom
|
|