update - been too dizzy this morning :-(
Turn the eval block into a string eval and wrap it in a BEGIN block. This way the eval is executed and the module loaded before the call to Win32::DriveInfo::DriveSpace is even compiled. I can't test, because I don't have a Windows box at hand.
Put this at the very beginning of your script:
BEGIN { if ($^O =~ /^(MS)?Win/) { eval "use Win32::DriveInfo"; die $@ if $@; } }
What happens if you turn the eval block into a string eval? I can't test, because I don't have a Windows box at hand.
--shmem
update: changed "require" to "use" in the string eval. Small negligence after copy & paste.
In reply to Re: How to execute succcessful this Perl script in Linux, window and solaris?
by shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
in thread How to execute succcessful this Perl script in Linux, window and solaris?
by wxfjordan
For:
Use:
& & < < > > [ [ ] ]