At 09:47 AM 5/12/2006, Yekhande, Seema \(MLITS\) wrote:
Holger,

Actually $ is a special character in string in perl. So, if the $ is there in the input,
you will have to always write it with the leading escape character.

So, make your input will be like this,
my $data = "Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!";

It will solve your problem.

$ is only special in strings with double quote marks ( " ) around them. I think you meant to say:

my $data = "Hello, i am a little String.\$ Please format me.\$\$\$ I am the end of the String.\$\$ And i am the last!";

That works, but, you can also use:

my $data = 'Hello, i am a little String.$ Please format me.$$$ I am the end of the String.$$ And i am the last!';

(Note the type of quote mark used)

If you were to print out the original string data like this:

my $data = "Hello, i am a litte String.$ Please format me.$$$ I am the end of the String.$$ And i am the last!";
print("$data\n");

you would get this:

Hello, i am a litte String. format me. I am the end of the String.1896 And i am the last!

i.e., the original string did not have any '$' characters in it at all.

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to