Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Can't locate define.pm

by Khen1950fx (Canon)
on Mar 08, 2012 at 01:17 UTC ( [id://958392]=note: print w/replies, xml ) Need Help??


in reply to Can't locate define.pm

define, like constant, is used at compile-time; hence, it has to be declared before any run. In this case, it really doesn't need to be used, but I used it to for debugging. The result might surprise you.
#!/usr/bin/perl use Modern::Perl '2012'; use strictures 1; no strict 'refs'; use Spreadsheet::ParseExcel; use Devel::SimpleTrace 'showrefs'; use define DEBUG => 1; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('tags sample.xls'); my $page = $workbook->{Worksheet}[0]; my ( $tags, $pages, $pviews, $pvisits ); format STDOUT_TOP = Tags Pages Page Views Page Visits . format STDOUT = @<<<<<<>>>>>>>>> @ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $tags, $pages, $pviews, $pvisits . my %i; foreach ( my $i = 0 ; $i{'MaxRow'} ; ++$i ) { $tags = cell( $page, $i, 0 ); $pages = cell( $page, $i, 1 ); $pviews = cell( $page, $i, 2 ); $pvisits = cell( $page, $i, 3 ); write; } cell(DEBUG); sub cell { my ( $Wks, $r, $c ) = @_; if ( defined( $$Wks{'Cells'}[$r][$c] ) ) { my $val = $$Wks{'Cells'}[$r][$c]->Value; chomp $val; return $val; } return ''; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://958392]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-19 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found