Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing parameters for a 'require'

Posted on 1998-08-06
5
Medium Priority
?
163 Views
Last Modified: 2010-03-05
I'm trying to modify the Matt's BBS script. What I want to do is to convert it in a multiple BBS system. It works with a .cfg file and I guess I should create several config files pointing to each BBS subdirectory I want to create, and pass to the script the cfg file name to use from the form.
I was trying to read a hidden variable and to use that variable with the 'require' statement, but what I tried didn't work. Can you help me? How to do it?
0
Comment
Question by:tenetor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:b2pi
ID: 1209119
I think the reason that you've not gotten an answer is that the question is incomprehensible.  Perhaps you could try and ask the question again, a bit more slowly?
0
 

Author Comment

by:tenetor
ID: 1209120
Edited text of question
0
 

Author Comment

by:tenetor
ID: 1209121
Edited text of question
0
 
LVL 5

Accepted Solution

by:
b2pi earned 100 total points
ID: 1209122
I have no clue what Matt's BBS script is, but perhaps this will give you a start: (3 different files (a.pl, b.pl, and c.pl) and then some command line stuff:

#-----------------------------------------
File : a.pl
#!/usr/bin/perl
$z = $ARGV[0];
die unless defined($z) && (-f $z);
eval {require ($z);} || die "eval of $z failed: $@";
&A;
print "All done\n";
#-----------------------------------------
File :b.pl
sub A {
  print "This is b.pl\n";
}
1;
#-----------------------------------------
File: c.pl
sub A {
  print "This is c.pl\n";
}
1;
#-----------------------------------------
>a.pl b.pl
This is b.pl
All done

>a.pl c.pl
This is c.pl
All done


0
 
LVL 5

Expert Comment

by:b2pi
ID: 1209123
Did this work? (It's considered polite to grade or re-open questions that have been answered)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question