Help for this page

Select Code to Download


  1. or download this
    Missing argument in sprintf at a.pl line 19, <DATAFILE> line 1.
    Character:              00
    
  2. or download this
    my @list = unpack( 'A' x length($string), $string );
    
  3. or download this
    my @list = unpack( 'a' x length($string), $string );
    
  4. or download this
    my @list = unpack( '(a)*', $string );
    
  5. or download this
    while (<DATAFILE>) {
        for my $ch (unpack('(a)*', $_)) {
           printf "Character:\t%s\t%2.2x\n", $ch, ord($ch));
        }
    }
    
  6. or download this
    while (<DATAFILE>) {
        for my $ord (unpack('C*', $_)) {
           printf "Character:\t%s\t%2.2x\n", chr($ord), $ord);
        }
    }