Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question in 1

Status
Not open for further replies.

MAWarGod

Programmer
Feb 15, 2002
352
US
sub ShowHeader{
$in{'m'} = 'Enters Room';
&WriteToChat;
&PageOut("$htmlpath/t_chat_banner.htm");
exit;
}

ok how do I make $in{'m'} = 'Enters Room'; to read from a file

a one line file.

so if I wanted to edit "Enter Room" to "walks in" from a page. I know how to open the file and edit it.
but don't know how to refrom the sub to read from it...

MA WarGod

I believe if someone can think it, it can be programmed
 
one possibility:


sub ShowHeader{
open(FH,'file.txt') or die "$!";
$in{'m'} = <FH>;
close(FH);
&WriteToChat;
&PageOut("$htmlpath/t_chat_banner.htm");
exit;
}


- Kevin, perl coder unexceptional!
 
Kevin Thank You so much

it works great and I can see how I will use this alot
as its seems I have been typeing sub's for hours looks to clock lol oh yea I have lol but I played with that one over and over and just couldn't see how to from.
so thank You again

MA WarGod

I believe if someone can think it, it can be programmed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top