RE: Simple Substition Question

2005-10-13 Thread Timothy Johnson
If you break down what you've written into an English approximation, you get something like this: # Create a variable $text, then assign $text the value 'hello'; Create a variable $text2, then assign $text2 the value 'bye'; Create a variable $text3, then substitute all inst

Re: Simple Substition Question

2005-10-13 Thread Jeff 'japhy' Pinyan
On Oct 13, Dave Adams said: my $text= 'hello'; my $text2 = 'bye'; my $text3 =~ s/$text/$text2/g; print $text3; What are you expecting to happen? There is NOTHING in $text3, so trying to substitute all "hello"s for "bye"s will result in Perl telling you that you're using an uninitialized val