#!/usr/bin/perl use strict; use warnings; sub cell_walk { my $self = shift @_; my ( $sheet_name, $x, $y, $callback, $callback_data ) = @_; my $Sheet = $$self{'book_handle'}->Worksheets($sheet_name); foreach $row( $row = $$x[0] ; $row <= $$y[0] ; ++$row ) { for ( my $col = $$x[1] ; $col <= $$y[1] ; ++$col ) { &$callback( $Sheet->Cells( $row, $col ), $callback_data ); } } } sub callback { # $_[0] = excel cell reference, $_[1] = XYZ object reference return if not defined $_[0]{'Value'}; if ( $_[0]{'Value'} =~ /^~~~/ ) { my (@a) = split( /__/, substr( $_[0]{'Value'}, 3 ), 0 ); if ( scalar @a == 3 ) { $_[0]{'Value'} = $_[1]->get_single_LP( 'ADAS_VAL_RAW', @a ); } if ( scalar @a == 4 ) { $_[0]{'Value'} = $_[1]->accu_LP( 'ADAS_VAL_NORM', @a ); } } }