Help for this page

Select Code to Download


  1. or download this
    open (my $file, '<', 'data.bin');
    binmode $file;
    ...
    $binary_data =~ /(.)(.){(?{unpack 'H*', $1})}/; # ?
    # or may be
    /(.)(?{unpack 'H*', $1})(.){$^R}/; # ???
    
  2. or download this
    /(.)((??{'.' x $1}))/;
    
  3. or download this
    $_ = "3aaaa\nbbbb\nccccc\nddddd";
    /(\d)((??{'.*?\n' x $1}))/;
    print $2; # aaaa\nbbbb\nccccc\n
    # how to assign a value aaaa\n of $3, bbbb\n -> $4 etc ?