#!/usr/bin/perl -w use Spreadsheet::ParseExcel; use strict; use warnings; use diagnostics; my $index = 1; my ($email, $token); my $filename = shift || "Test.xls"; my $e = new Spreadsheet::ParseExcel; my $eBook = $e->Parse($filename); my $sheets = $eBook->{SheetCount}; my ($eSheet, $sheetName); foreach my $sheet (0 .. $sheets - 1) { $eSheet = $eBook->{Worksheet}[$sheet]; $sheetName = $eSheet->{Name}; # print "Worksheet $sheet: $sheetName\n"; next unless (exists ($eSheet->{MaxRow}) and (exists ($eSheet->{Max +Col}))); foreach my $row ($eSheet->{MinRow} .. $eSheet->{MaxRow}) { foreach my $column ($eSheet->{MinCol} .. $eSheet->{MaxCol}) { next unless (defined $eSheet->{Cells}[$row][$column]); if ( ($index % 2) == 1 ){ $email = $eSheet->{Cells}[$row][$column]->Value; print $email; } else{ $token = $eSheet->{Cells}[$row][$column]->Value; print $token; } } getvalue1(); } } getvalue1{ print "$email : $token"; }
Error:
Undefined subroutine &main::getvalue1 called at sample.pl line 37 (#1)
(F) The subroutine indicated hasn't been defined, or if it was, it has
since been undefined.
Uncaught exception from user code:
Undefined subroutine &main::getvalue1 called at sample.pl line 37.
Thanks
AlokIn reply to Undefined subroutine &main:: by alokranjan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |