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
Quote Reply
Re: [RedRum] Extraction Regex In reply to
I win the stupid person award.

Default => use lib '';

Regex => use lib '[^']+'

Duh!

Last edited by:

RedRum: Feb 24, 2002, 7:29 AM
Quote Reply
Re: [RedRum] Extraction Regex In reply to
I sometimes wonder why you post your questions here, you always seem to answer your own questions Tongue (j/k)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!