in reply to Control:CLI or Net::SSH2 - Send <ctrl>_

NOTE: While it doesnt show here there is a character between the two quotes in my $a='';

use strict; use warnings; my $a=''; # entered by holding down cntrl pressing _ (shift+-) print "ord:".ord($a)."\n"; print 'hex:'.unpack("H*", $a)."\n"; my $b="\x1f"; if ($a eq $b) {print '$a eq $b'."\n";} exit;
result
ord:31 hex:1f $a eq $b
but!!
#use strict; use warnings; my $a=''; # entered by holding down cntrl pressing _ (shift+-) print "ord:".ord($a)."\n"; print 'hex:'.unpack("H*", $a)."\n"; my $b="\x1f"; if ($a eq $b) {print '$a eq $b'."\n";} my $bb=\x1f; print $bb."\n";
Result
ord:31 hex:1f $a eq $b SCALAR(0xa3e67c)
so did you try printing \x1f or "\x1f" ?

Replies are listed 'Best First'.
Re^2: Control:CLI or Net::SSH2 - Send <ctrl>_
by ImJustAFriend (Scribe) on Feb 21, 2017 at 01:56 UTC
    Thank you very much for the feedback. I tried both ways, neither worked. :(