Help for this page

Select Code to Download


  1. or download this
      # set this up once...
      my %cols = ( UN  => 0, RN  => 1, LOC => 2, ... );
    ...
    
      # for each prompt to fill in:
      $prompt =~ s/-($cols)-/$user_info[ $cols{$1} ]/g;
    
  2. or download this
      # once
      my @col_info = ( UN  => 0, RN  => 1, LOC => 2, ... );
    ...
    
      # and our substitution turns into this:
      $prompt =~ s/-($cols)-/$user_info{$1}/g;