Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use Term::ANSIColor;
- sub hex_to_string {
- my $hex_input = shift;
- my $string_representation = pack("H*", $hex_input);
- return $string_representation;
- }
- print color('bold blue');
- print "Masukkan representasi heksadesimal: ";
- print color('reset');
- my $user_hex_input = <STDIN>;
- chomp($user_hex_input);
- my $string_result = hex_to_string($user_hex_input);
- print color('bold green');
- print "String dari representasi heksadesimal '$user_hex_input': $string_result\n";
- print color('reset');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement