NAME

RackMan::Utils - Utility functions

DESCRIPTION

This module contains several utility functions, grouped here to avoid duplicated code.

FUNCTIONS

diff_lines()

Compute the differences between two input files (given as arrayrefs) using Algorithm::Diff, and return the result as an array. Color codes are added if the output is a terminal.

Arguments:

1. first input file (mandatory, arrayref)
2. second input file (mandatory, arrayref)
3. options (hashref)
  • input_A_header - set the diff header for input A

  • input_B_header - set the diff header for input B

Return:

  • diff result (array in list context, arrayref in scalar context)

parse_regexp()

Parse the given string and return the corresponding Perl regexp (qr//).

Arguments:

1. input string

Return:

  • in scalar context: the resulting regexp

  • in list context: the resulting regexp, parsing error

AUTHOR

Sebastien Aperghis-Tramoni