i am trying to write a code which will take a non printable character as an input and used as a separator for different fields
ex : if user gives an input \xd1 the o/p should be field1 ╤ field2
initially i have written a code to get the below lines in my program hex.pl
Expand|Select|Wrap|Line Numbers
- use strict;
- my $seperatorArg;
- $seperatorArg = shift(@ARGV);
- print "field1 $seperatorArg field2";
field1 \xd1 field2
if i hardcode the value in my code like
Expand|Select|Wrap|Line Numbers
- $seperatorArg = "\xd1";
can anybody explain my below understanding is correct?
what i am thinking is when i hard code, the value i gave in double quotes and hence the variable interpoplation is occuring which results in hex character
when i gave the same value as input in command line the value is getting in single quotes which is not getting interpolated and hence the same value is being printed.
please point me to the right direction if i am in wrong direction, so tht i can put more effort to make my code to behave in the way i want.
Thanks
Raj