Gossamer Forum
Home : General : Perl Programming :

include file question

Quote Reply
include file question
i have a lot of elsif statements in a sub that's called by eval &main

is it possible to include a text file in the middle of them that has more elsif statements? the included file has some custom elsif statements that i don't want to overwrite accidentally if i replace the file that contains sub main.
Quote Reply
Re: [delicia] include file question In reply to
Sorry, not really sure what you are asking for? You want to include a file that has extra if/else conditions in, and process it as part of the main() conditionals? I'm not sure tha0'ts possible. You could put them in a .pm file, and then "require" the code, then do something like:

Code:
if (foo) {

} elsif (bar) {

} else {
use Module;
process_other_conditionals()
}

But it's a bit messy. You would be better to make the changes to the main file, and just keep a .bak version of the file, in case you overwrite it by accident ;)

Cheers

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!
Quote Reply
Re: [Andy] include file question In reply to
that's what i figured! (except of course i didn't figure your possible solution!)