Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Scripts work when run individually but not when run as one compiled script

by shmem (Chancellor)
on Jan 20, 2016 at 10:00 UTC ( [id://1153161]=note: print w/replies, xml ) Need Help??


in reply to Scripts work when run individually but not when run as one compiled script

Apart from the hint given in Re: Scripts work when run individually but not when run as one compiled script by GotToBTru - three points:

  1. You mix path delimiters.
    sub csv_xlsx{ my $dir = "C:\\Temp\\Data"; foreach my $fp (glob("$dir/*.csv")) { ... } unlink glob "C:\\Temp\\Data\\*.csv" or warn $! ; }
    To avoid that, always use File::Spec for path operations.
  2. Did you check what those glob() expressions do return?
  3. What are you doing with @class_files ?

And a last hint - to format your indenting before posting, you can use Perl::Tidy, which expands tabs and sets the shift width to 4 spaces, given the proper rules for that. ;-)

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-24 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found