Home: Perl Programming Help: Beginner:
Inconsistent Undefined subroutine error for cwd



tharpa
Novice

Jul 22, 2016, 9:03 AM


Views: 1876
Inconsistent Undefined subroutine error for cwd

I am getting a message, "Undefined subroutine &compression_dev::cwd called at ..." for this line

Code
my $cwd = cwd();

. I have a

Code
use Cwd;

at the top of the file. What it makes even stranger is that I have that same line in other places in the same file (different subroutine) but it is working correctly.

Any thoughts?
***************
Well, I don't know why it wasn't working, but I found a work-around:

Code
my $curwd = Cwd::abs_path();



(This post was edited by tharpa on Jul 22, 2016, 10:23 AM)