Help for this page

Select Code to Download


  1. or download this
    # Open the file containing data or abort with error message
    open(my $fh, "<", "some_file.txt") || die "Can't open file: $!";
    ...
          "Time: $timePoints, Difficulty: $diffPoints\n\n";
      }
    }
    
  2. or download this
      # Assign only the columns you're interested in
      my ($timePoints,$diffPoints,$name) = +(split(/\s+/,$line,13))[3,11,1
    +4];
    
  3. or download this
      # Ensure the line consists of 12 integers + something
      my ( ... ) = ($line =~ /^\s*(?:(\d+)\s*){12}(.*)/);
    
  4. or download this
      next unless $line =~ /(intrepid|triumph)/;
      my ( ... ) = ...;
      print ....;