Johnno wrote:
>
> How do i change $value="View Data" to $value="View_Data";
I guess you mean you want to substitue all spaces with underscores?
$value =~ tr/ /_/;
If you need any number of consecutive spaces to be a single underscore:
$value =~ tr/ /_/s;
If you need any amount of white spa
The regex below will replace the space with an underscore.
my $value="View Data";
$value =~ s/ /_/;
Bryan
-Original Message-
From: Johnno [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 7:55 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] Changing values
How
If all you are wanting to do a change a scalar variable then you just did it
and answered your own question.
Try:
$value = "View Data";
print "$value\n";
$value = "View_Data";
print "$value\n";
If what you are trying to do here is turn all spaces into underscores then
you need a regex something