Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Perl cgi UNIX script query...

Options
  • 30-09-2004 10:04am
    #1
    Posts: 0


    Hey,

    Just a question regarding cgi perl scripts running on Unix systems.

    I have a section of code, which opens a handle on the "w" command on a unix system, the idea being to see who is currently logged on at the moment.
    open(CMD, "w|"); @list = <CMD>; close(CMD); foreach(@list) { print "$_\n"; }
    

    however, this bit of code works from the command line (it prints out the entire command output) but from the browser (when run as a cgi-script), it only shows about 8 lines, where they are far more users on.

    Is there some kind of admin restriction on such a thing?

    Thanks for any help


Comments

  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    That line works fine on a machine here, with 15 users. Wonder if its a buffer thing, and that you should be using something like ...
    while( <CMD> ) { print "$_\n"; }
    
    .. instead?
    .cg


Advertisement