Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Regular expressions: interpolate the variable in the value of the number of repetitions for the group

by 0day (Sexton)
on Aug 02, 2013 at 23:02 UTC ( #1047667=perlquestion: print w/ replies, xml ) Need Help??

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 ?
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1047667]
Approved by rjt
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2014-07-29 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls