in reply to "Global Symbol Requires Explicit Package Name" error
You should get used to write module names in the right case (here: Win32::OLE), or your programs will throw "module foo::bar not found in @INC..." errors if they are ever run on a case-sensitive file system.use strict; use warnings; use win32::ole;
ugh.my ($f_mfg_desk, $f_mfg_desk_output, $record,@wip_query, $wip_query, $ +opr_cd, @header, $header, %header, $x, $row, $row_array, @row_array, @rule_array, $ +BREAK, $year, $month, $day, $hour, $min, $sec, $run_time, $dtme, $local_outfile_timestamp, $remote_outfile_timestamp, $local_outfil +e_latest, $remote_outfile_web, $Oper_Cd, $Pick_Ref_Num, $Part_Id, @header_da +ta, $newrow, @newrow, $head);
This assigns a scalar and does not "get" anything. (cut & paste reduce problem fragment?)# This gets the document from the server $f_mfg_desk = '//142.22.50.34/planning/logistics/programs/wip_query.tx +t';
A good example of bad scoping. $record here is just used within the loop, so you'd better write that as... open (INFILE, '//163.10.50.33/planning/logistics/programs/chicago_wip_ +query.txt'); while (<INFILE>) { $record = $_; chomp($record); @newrow = split(/\t/,$record);
Also, you are just using $record to chomp and split it, so after all your code would be smarter writtenwhile (my $record = <INFILE>) {
which is a bit shorter and more concise.while (<INFILE>) { chomp; @newrow = split /\t/;
This also can be written with a bit less effort.$header_data{$newrow[2]} = [$newrow[3], $newrow[4], $newrow[5], $n +ewrow[6], $newrow[7], $newrow[8], $newrow[9], $newrow[10], $newrow[11 +], $newrow[12], $newrow[13], $newrow[14], $newrow[15], $newrow[16], $ +newrow[17], $newrow[18]]; }
$header_data{$newrow[2]} = [@newrow[3..18]];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "Global Symbol Requires Explicit Package Name" error
by Portree (Novice) on Aug 09, 2005 at 21:03 UTC | |
by kutsu (Priest) on Aug 09, 2005 at 22:30 UTC | |
by Portree (Novice) on Aug 09, 2005 at 22:54 UTC | |
by kutsu (Priest) on Aug 10, 2005 at 20:09 UTC | |
by benizi (Hermit) on Aug 11, 2005 at 17:51 UTC |