mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-30 02:12:38 +00:00 
			
		
		
		
	Fix perl use of 'use lib'
The 'use lib' logic happens in the pre-compile stage, so one cannot use normal 'if' logic to use a particular INC. Instead, just make sure that best dir is added to 'use lib' last since it prepends to INC.
This commit is contained in:
		| @@ -15,12 +15,12 @@ $SIG{ __WARN__ } = sub { Carp::confess( @_ ) }; | ||||
|  | ||||
| # Un-buffer output | ||||
| $| = 1; | ||||
| if (-f "LANforge/Endpoint.pm" ) { | ||||
|    use lib "./"; | ||||
| } | ||||
| else { | ||||
|   use lib '/home/lanforge/scripts'; | ||||
| } | ||||
|  | ||||
| # use lib prepends to @INC, so put lower priority first | ||||
| # This is before run-time, so cannot condition this with normal 'if' logic. | ||||
| use lib '/home/lanforge/scripts'; | ||||
| use lib "./"; | ||||
|  | ||||
| use LANforge::Endpoint; | ||||
| use LANforge::Port; | ||||
| use LANforge::Utils; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ben Greear
					Ben Greear