Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

control caracters passed in parameter

Status
Not open for further replies.

wysiwyg

Programmer
May 8, 2000
6
CA
Hi<br>I'm new to perl and what I want to do is this:<br>I'm receiving a string which contain control caracters ex: $<br>Perl is interpreting them as a variable <br>ex : 02,$VER,DO<br>what I receive in perl is :02,,DO<br>what I expect to receive : 02,$VER,DO<br>tks in advance<br>Annie
 
throw the '\' character (only the \, not the ') in front of it. That's your control character. Best of luck! <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
I can't put the caracter \ before the $ sign .Because I receive the&nbsp;&nbsp;list who contain it from a rex .The rex script call my perl script and gives him parameters which contain $,@ and # caracters.From the moment I received the list perl sees them as variable
 
a rex? I'm not familiar with rex.. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Without seeing your code, I'm guessing that you are using double quotes (&quot;) to surround the string you are receiving?&nbsp;&nbsp;For example:<br><FONT FACE=monospace><br>$My_Received_String = $ARGV[0];<br><br>print &quot;$My_Received_String\n&quot;;<br></font><br>This would exhibit the behaviour you describe.&nbsp;&nbsp;To prevent perl from interpreting $VER as a scalar, surround the string in single quotes (').&nbsp;&nbsp;For example:<br><FONT FACE=monospace><br>$My_Received_String = $ARGV[0];<br><br>print '$My_Received_String\n';<br></font><br>That should do the trick.<br><br>PS, if I recall correctly, isn't REX a programming language from IBM?&nbsp;&nbsp;And if TeX (the layout language) is pronounced &quot;Tek&quot;, is REX pronounced &quot;Rek&quot;? &lt;/bad humour off&gt;&nbsp;&nbsp;;^) <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top