in reply to RE: RE: RE: Re: Inputing info into Nested Arrays
in thread Inputing info into Nested Arrays

What we're all trying to say is:
How would you prefer to write it? Perl can parse that.
But without any concrete preferences other than "I want to end up with data structure X", all we can do is put little snippets out there.

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: RE: RE: RE: Re: Inputing info into Nested Arrays

Replies are listed 'Best First'.
RE: RE: RE: RE: RE: Re: Inputing info into Nested Arrays
by She-wolf (Sexton) on Aug 21, 2000 at 21:06 UTC
    Basically, I need to read in a text file and have each projects information put into an array. I later need to be able to easily call up a project with a certain ID number and have the information displayed in an html file and then also make it accesible to be updated.

    I'm hoping for an easier way then having to write something to compare an inputed project ID number to a row in the format previously shown.

    e.g. I don't want for project 35 to have to call up $array34,0, $array34,1, $array34,2, etc.

    This has to be easily usable for non tech people and take an unknown number of projects(up to 100)

    She-wolf
    "Wha? I don't get it."

      Unless you intend on reparsing the "text file" on each CGI hit, you'll probably want a real database for this. And again, what would the text file look like, ideally?

      -- Randal L. Schwartz, Perl hacker

      She-Wolf

      Try this URL: A HREF = "http://webreview.com/pub/98/10/23/perl/index.html">http://webreview.com/pub/98/10/23/perl/index.html

      It's an online, text based database that you can download and reconfigure fairly easily. The text is tab delimited. You can search on the various fields. If necessary, you can have links between different text databases, simply by setting up the appropriate CGI scripts.

      Individual records are parsed into an array, whose elements can be printed into a table individually (eg some as plain text, some as hyperlinks).

      I've used it in the past, so I'm reasonably familiar with it if you want to use it. It would at least give you an idea as to where to start.

      MadraghRua
      yet another biologist hacking perl....

        I'm just curious as to whether or not you've found his use of reserved words for variables a problem when using this program.

        Also, I was just wondering if you've had any problems using this application.

        She-wolf
        "Wha? I don't get it."

        Have you had a problem with:
        Can't find string terminator "HTML" anywhere before EOF at database.cgi line 135. ?

        She-wolf
        "Wha? I don't get it."

      I agree with merlyn that a database scales better. But still take a look at the default output of Data::Dumper and see whether that is a sufficiently readable text format for your purposes.

      (I admit to having done that once or twice. :-)