FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Problem with perl script





giovle
Hi,

I'm working on a database script that should be able to read from a .txt file.
The database is made up of little blocks:
First of all a block that states the title of a document in different languages like:
Code:
[title_en] The calendar of Idiot's Delight

Each time the name of the line between right brackets, then a space and then the information that comes with the name. The titles are know read and now the part starts that doesn't work really well.

Between every block is a white rule.

All the next blocks are made up of 7 different inputlines (a date, name of the event in three languages and the info about an event in three languages). All of these seven lines should be read per event. and so doing each event.

The information is stored in an array of hashes. So each event is stored as an element in the array. Each 'event-element' is really a hash. In that hash are the name - information couples of each line that is within the block of that element.

For some reason, when I tried to run it through cmd, only the third event gets printed, but three times. So instead of getting 7 lines starting with 0: and then the rest of the info of the first event, 7 lines starting with 1: and then the rest of the info of the second event and then 7 lines starting with 2: and then the rest of the info of the third and last event ... I get three times 7 lines, respectively starting with 0, 1 and 2, but each time with the information about the last event. So I think the first two events must have been overwritten or something.

I'll put the files available on my webspace, should you want to take a minute and help me. I'm new to Perl, so I tried to add as many comments between the code as possible. You should also change the location of the perl bin if you download it ... but I guess you knew Wink

Here are the two files, the database file and the script itself
http://giovle.frih.net/temporary_script/testje.txt Remember to change the txt extension to pl, had to change that to make it downloadable ...
http://giovle.frih.net/temporary_script/events_tijdelijk.txt

Thanks anyway for your time!

Giovanni
giovle
Hi,

in the meanwhile I was able to fix the bug, so this topic can be closed down now ...

Grtz

Gio
Related topics
Running a Perl script in the background
executing a perl script
CGI/Perl Script to backup a website.
I have a perl Script.. but i dont know how to use.
im installing a perl script in my website and..
HELP needed with basic Email perl script.
executing a perl script from within a script
problem with cgi perl script
CGI FormMail Script Part II
Show ip adress from perl -script need help
Perl problem
PERL - post data from one script to another (Without LWP)
Executing a Perl CGI script
writing COM components in Perl
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.