Formating of query variable in perl

Hi ,

I am facing error in perl
when I assign a below query in a varibale $query because of new line charchters

$query=
SELECT   XYZ
     ,       ABC    
     ,       c2
     ,       c3
     ,       c4
FROM     t1

how can i get rid of new line charchters with out changing the format of the query.

I tried to replace tr "\n " ' ' but it is changing the format.

Thanks
Vk

I don't quite understand your requirement. Please post the desired output. What should $query exactly contain?

May be:

#!/usr/bin/perl

$query=q/SELECT   XYZ
     ,       ABC    
     ,       c2
     ,       c3
     ,       c4
FROM     t1/;

print $query."\n"