Author:
erics , April 16th, 2021
The key is to define a variable first, then use the BEGIN block to initialize the variable, then reference the variable in use lib $var; later on ;-} For example, enable a module contained in the same directory as a script called via the PATH:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/ussr/bin/env perl
use strict ;
use warnings ;
our $ scriptPath ;
BEGIN {
eval {
use File :: Basename ;
use File :: Spec ;
$ scriptPath = dirname ( File :: Spec -> rel2abs ( __FILE__ ) ) ;
1 ;
} or do {
die "$0 use CRASHED: $@" ;
} ;
}
use lib $ scriptPath ;
eval {
use MyModule :: ABC ;
1 ;
} or do {
die "$0 use CRASHED: $@" ;
} ;
Categories: How-To's , Technology Tags: @INC , compile , Compile-time , Dir , directory , howto , include , lib , Library , module , Path , perl , require , Run-time , runtime , tips , Use , use lib
| No comments
Author:
erics , December 20th, 2018
// include custom jQuery
function wyz_include_custom_jquery ( ) {
wp_deregister_script ( 'jquery' ) ;
wp_enqueue_script ( 'jquery' , 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js' , array ( ) , null , true ) ;
}
add_action ( 'wp_enqueue_scripts' , 'wyz_include_custom_jquery' ) ;
Categories: How-To's , Technology Tags: add_action , howto , include , JQuery , Min , tips , WordPress , wp_deregister_script , wp_enqueue_script , wp_enqueue_scripts
| No comments
Author:
erics , February 5th, 2017
rsync -avzn –progress –include=’*.png’ –include=’*/’ –exclude=’*’ /the/source/path/ user@theServer:/the/target/path/
Categories: How-To's , Technology Tags: exclude , Extension , File , Filter , howto , include , PNG , rsync , tips
| No comments
Author:
erics , March 21st, 2012
set_include_path(get_include_path().PATH_SEPARATOR.'{DESIRED_NEW_PATH_TO_ADD}’);
Categories: How-To's , Technology Tags: howto , include , Include Path , php , tips
| No comments