Help:load unix ls>@array for use in cgi list box 
Author Message
 Help:load unix ls>@array for use in cgi list box

Hi all,

firstly - I use comminicator for my news client, are my messages still not
ideally formatted for NGs?  Wordwrap - 80 (I can't seem to turn it off)with
8-bit text only.

I want to display a list of files from a directory in a html list box using a
perl cgi.  This must have been done a million times by now so has anyone got
anything handy they could e-mail me to save
me the time?

You might remember I had a problem with the Shell command causing a Segmentation
Fault.  I never resolved this, but got a workaround with the system function.
I'm don't know how to use system or exec to pull data into an array, exec also
seemed to prevent any further output in my cgi.
I was advised about the my function but can't figure out the basics. ie what is
the correct version of the following.  



print $mylist[1..5];   #first five files

Cheers,

Mark Hamlin
--

        ___....-----'---'-----....___
  =========================================
         ___'---..._______...---'___
        (___)      _|_|_|_      (___)
          \\____.-'_.---._'-.____//
            ~~~~'.__'---'__.'~~~~
                   ~~~~~~~
        'More speed'
                  Sisco



Please use you auto reply where possible to distribute to both mailboxes.



Tue, 08 May 2001 03:00:00 GMT  
 Help:load unix ls>@array for use in cgi list box
[posted & mailed]

: firstly - I use comminicator for my news client, are my messages still not
: ideally formatted for NGs?  Wordwrap - 80 (I can't seem to turn it off)with
: 8-bit text only.

        Wordwrap at 80 is what you want.  8-bit text isn't, it should be
        7-bit but you haven't used any "hi ascii" in your message so it's
        ok.  Just don't use "vcard" or html and you'll be fine.

: I'm don't know how to use system or exec to pull data into an array, exec also
: seemed to prevent any further output in my cgi.

        Exec() will never return.  In layman terms, it morphs your program
        into the one you call, the original no longer existing.

: I was advised about the my function but can't figure out the basics. ie what is
: the correct version of the following.  
:


: print $mylist[1..5];   #first five files


        Those are "back ticks" (the "`" char), not single quotes ("'").

        Also take a look at the opendir() and readdir() functions in the
        perlfunc man page.

--

BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".



Tue, 08 May 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Help:load unix ls>@array for use in cgi list box

2. Help:load unix ls>@array for use in cgi list box

3. parse_dir function in File::Listing - wrong time for unix ls output

4. add only file names to list using ls command

5. NEWBIE: Need help with file -> array loading

6. >> Array of Lists - Thanks to all

7. List Boxes & Text Boxes

8. need help:msworddoc->doc.txt->unix.txt

9. Unable to find load file LS

10. Can't load NDBM array with list

11. Loading arbitrary sized list into associative array

12. About loading image for CGI (Unix Sh)

 

 
Powered by phpBB® Forum Software