Nevermind on this problem, I fixed it but will be in touch. thx. derek
Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams Derek Smith/Staff/OhioH ealth To beginners-cgi@perl.org 11/04/2005 03:08 cc PM Subject RE: implementing links on a system command output(Document link: Derek Bellner Smith) "Charles K. Clarkson" <[EMAIL PROTECTED] To .net> <beginners-cgi@perl.org> cc 10/21/2005 06:29 PM Subject RE: implementing links on a system command output [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote: : thx Charles, but your code is something I did knew (sic) already. : I need to implement a link for each H string and I do not see : this??? I assume by "implement a link" you mean that you want to create an HTML ANCHOR tag for each H String. After re-reading your original question on this thread I think you are looking for more than just an anchor tag. You also need a method to retrieve "capacity data sets" after a link has been followed. Here is my solution. my $url = 'capacity.pl?hstring'; my @links; foreach my $h_string ( @h_strings ) { push @links, $q->a( { href=> "$url=$h_string" }, $h_string ); } print $q->ul( $q->li( [EMAIL PROTECTED] ), ); # in capacity.pl #!/usr/bin/perl use strict; use warnings; use CGI; my $q = CGI->new(); my $h_string = $q->param( 'hstring' ); print $q->header(), $q->start_html( "Capacity Data for $h_string" ), $q->p( capcity_data( $h_string ) ), $q->end_html; sub capcity_data { my $h_string = shift; # # Do that thing you do to get capacity data and # deposit the result in $capacity_data. # return $capacity_data; } __END__ : So in the FH reference local *ARC; : once its open, I can just reuse the reference right? Does the : FH have to still be open in order to reuse it? I don'tknow what you are asking. For more info on why I added "local *ARC;" read this article. http://perl.plover.com/local.html#2_Localized_Filehandles HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 ************************************************************************ ************************************************************************ Ok after a few mods, I got this working wherein each hstring is a link to capacity.pl which is supposed to run and gather the capacity data, but I am getting "page not found" and in the URL it is displaying: http://stkv440.ohnet/cgi-bin/=%20%20%20H01196 So it sounds like to me capacity.pl is not being opened and executed. In the code: my $url = 'capacity.pl?hstring'; my @links; foreach my $h_string ( @h_strings ) { push @links, $q->a( { href=> "$url=$h_string" }, $h_string ); } print $q->ul( $q->li( [EMAIL PROTECTED] ), ); __END_CODE__ the a href is supposed to be opening and executing this capacity.pl file, but it is not??? my permissions and ownership are correct on this file and the system app command permissions and ownership bits are ok. my command string in capacity.pl that is getting the capacity data looks like: my $capacity_data = (grep /${SF}${h_string},grep s/[-,silobdER]//g, `archiver -v`); One last thing I noticed.... if I take off the reference to the array @links then the elements appear as one link, but each its own h_string as so: Is it b/c we are saying print the entire array as opposed to with a reference it is printing each element or the ref???? whats the diff??? H01196 H01194 H01198 H01200 H01201 H01202 Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams thank you! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>