|
|
Joined: Sep 2000
Posts: 138
Member
|
Member
Joined: Sep 2000
Posts: 138 |
How would I take a .txt file and use a script to open it up and take whats in the .txt file and turn all of that into a $ varible? Thanks. I'm trying to mess with alot of my scripts and I need to know how to do this. Thanks! ------------------ Wanna See A Real BB?...So your on one, But heres another! This message has been edited by Em8 on September 22, 2000 at 03:54 PM
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
Turn all fo that into a variable how?
As: my $var = [entire contents of the file];
or: file contains: blah = 1 blah2 = cheese
and you want your program to now have $blah with a value of 1 and $blah2 with a value of 'cheese'?
--mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Sep 2000
Posts: 138
Member
|
Member
Joined: Sep 2000
Posts: 138 |
I dunno if that was it but any way, I wan't to make a script and to make it easier on people who don't know perl, they type in the cuss word in the .txt file instead of looking for the varibles. so badw.txt contains: How would I take all that into a single $ like $badwords in another CGI script? ------------------ ........... This message has been edited by Em8 on September 22, 2000 at 09:14 PM
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
It would be better for you to structure your file as: bad1 bad2 bad3 bad4 then just do: You now have your words in the @bad_words array which you can check against your data. Andy: No, I still wouldn't slurp. But if its a small file, then this is one instance where I don't get too mad at people for doing it ![[Linked Image]](https://ubbdev.com/ubb/smilies//smile.gif) --mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
![[Linked Image]](https://ubbdev.com/ubb/smilies//biggrin.gif) ------------------ Da Wannabe Cannuck
|
|
|
|
Joined: Sep 2000
Posts: 138
Member
|
Member
Joined: Sep 2000
Posts: 138 |
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,932
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|