Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Perl cgi UNIX script query...

  • 30-09-2004 10:04AM
    #1
    Posts: 431 ✭✭


    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, Registered Users 2 Posts: 3,890 ✭✭✭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