CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
How do i do this??

 



keith2045
Deleted

Jan 16, 2001, 7:00 PM

Post #1 of 2 (206 views)
How do i do this?? Can't Post

Hi all.

I am kinda of new to perl so i have some questions. Here they are

I have a web site that has lots of differents of programs and i have
different informaion about them, for example the name of the program then age
req. to join, are they interational. I put all that into a txt file. Here is
what it looks like

Spedia::18+::International

There will be a lot more programs but this is just an example. Say i want to
print this information on page 1 and on page 4 is their a way where i can put
like pg1 and it will just print it on page 1 and then i put 4 and it will
print on page 4 also? Something like this
1/4::Spedia::18+::International
I am doing this because this information changes a lot and i dont want to
have to go to each page and update, so this way i just update 1 file. I hope
you understand what i mean.

One more thing. How can i just pull one line of information? For example i
want to print Spedia. What do i put in my program? Here's what the text file
looks like.

Alladvantage::18+::International
Epipo::14+::USA
Spedia::18+::International
Allcommunity::12+::Canada

I think that is all.
Thanks

Keith





S_Shrum
User

Jan 17, 2001, 10:22 AM

Post #2 of 2 (196 views)
Re: How do i do this?? [In reply to] Can't Post

I am new to Perl as well but have programmed in VB, ADA, C++, and now Perl (for about a month).

Ah...another flatfile-head (no offense...me too). I was (sorta) in the same boat. Now this is not the only way, just the way I seem to like...

There are two ways to attack this...You can load the data into either a multidimensional array or a hash. I, myself, have opted for using arrays for my data.

As for the searching, I am in the process of writting a open-source generic flatfile -> html table script that allows for a number of factors like searching for a value and searching for a value in a specific field. It then outputs those records that match. You can use it either with a template (uses the GREP command to do search and replace) or as a SSI call from within a existing page (by omitting the &template parameter).

It still needs a little work plus I need to standardize some things but feel free to look it over. It works great on NT but I am fixing some UNIX issues. If you see something that can be improved on, let me know.

http://www.shrum.net/db_table.pl <-- as of Jan 9th

I should have it done within a week or 2 (school starts up next week) but if your in a rush you can get the general idea from what I am doing.

As for the printing of specific pages...hmmm...you can do it but you would need to specify a range...sorta like search pages allow you to see 10 records a page but gives you the option of jumping to page 4 (records 40-49). Sorta like:

...&show=10&page=4

I will most likely implement something like this in my script later in the week. As for doing it at the same time...maybe someone else knows (short of hard coding a page and putting 2 #exec lines in them but that's not very practical).

Hope this helps. This forum has been good to me so I share the wealth (of knowledge).

Sean Shrum
sean@shrum.net


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives