in reply to Re: html->perl->c->perl...... work dang it
in thread html->perl->c->perl...... work dang it

this replaced the head of the first perl script... still no luck in the area of getting it to jump throught my C program though.......
#!/usr/local/bin/perl -wT use strict; use CGI; if ($#ARGV==0) { my $post_data=new CGI; my $username=$post_data->param('username'); my $on_off=$post_data->param('on_off'); my $message=$post_data->param('message'); } else { &Command(); } @junk = ("authorize", "vacation.pl", $username, $on_off, $message); $runme = join (" ",@junk); &Header();

Replies are listed 'Best First'.
Re: Re: Re: html->perl->c->perl...... work dang it
by halley (Prior) on May 15, 2003 at 17:07 UTC

    If an array is empty, ($#ARRAY == 0) is false. $#ARRAY is -1 for an empty array, because $#ARRAY returns the index of the last valid element, not the number of elements in the array. An array with one element has a last element of index zero.

    You can do your check for an empty argument list with any of the following: (not @ARGV), (0 == @ARGV), or ($#ARGV < 0). I prefer the first, but it's a matter of style.

    --
    [ e d @ h a l l e y . c c ]

      Thank you very much i will implement that