Gossamer Forum
Quote Reply
Extraction Regex
I'm trying to insert the right path to perl, lib path etc, when extracting a file during the plugin setup process. Here is the code I have:

$code =~ s,use lib '[^']+',use lib '$CFG->{admin_root_path}',;
$code =~ s,Links::init\(\),Links::init('$CFG->{admin_root_path}'),;
$code =~ s,Links::init_user\(\),Links::init_user('$CFG->{admin_root_path}'),;


The thing is, only the last two regex's work. The use lib one won't do as it's told :)

....is the default file I have:

use lib '';
use Links::init();
use Links::init_user();

....and after extraction I have:

use lib '';
use Links::init('/path/to/admin');
use Links::init_user('/path/to/admin');

I've used this code before and it works but I can't see why it doesn't this time Unsure

Last edited by:

RedRum: Feb 24, 2002, 7:29 AM
Subject Author Views Date
Thread Extraction Regex Paul 2528 Feb 24, 2002, 7:25 AM
Thread Re: [RedRum] Extraction Regex
Paul 2479 Feb 24, 2002, 7:29 AM
Post Re: [RedRum] Extraction Regex
Andy 2492 Feb 25, 2002, 5:00 AM