right under the $content variable assignment and the dang thing came back undef but what is more the script somehow printed the frameset and gave me the "no damn content" message in both frames!! I am so baffled. Any advice heartily welcomed!!my $content = $q->param( 'content' ); if (!$content){ print $q->header,"no damn content"; exit; }
_____________________________________________________#!/usr/local/bin/perl -w use strict; use CGI; my $q = new CGI; my $path_to_top = "/home/somesite/www/site/main_frame_top3.html"; my $content = $q->param( 'content' ); my $TITLE="Welcome to New Orleans"; my @top_file; my $script_name; my $path_info = $q->path_info; print $q->header; # If no path information is provided, then we create # a side-by-side frame set if (!$path_info) { &print_frameset; exit 0; } &print_html_header; &print_top if $path_info=~/top/; &print_mainframe if $path_info=~/main/; &print_end; # Create the frameset sub print_frameset { $script_name = $q->script_name; print <<EOF; <html><head><title>$TITLE</title></head> <frameset rows="147,*" frameborder="NO" border="0" framespacing="0" co +ls="*"> <frame src="$script_name/top" scrolling="NO" name="topFrame"> <frame src="$script_name/main" name="mainFrame"> </frameset> EOF ; exit 0; } sub print_html_header { print $q->start_html($TITLE); } sub print_end { print $q->end_html; } sub print_top { open (FH, "$path_to_top") or die "where's the damn file? : $!"; @top_file = <FH>; close FH; print @top_file; } sub print_mainframe { print "starting to open $content"; open (OH, "$content") or die "where's the damn file? : $!"; my @bot_file = <OH>; close OH; if (!@bot_file) { print "empty array! whassup wi'dat?"; exit; } else { print "the array is @bot_file!"; exit; } print @bot_file; print "finish"; }
In reply to Why is this param undefined? and Why isn't exit stopping the script from running? by jerrygarciuh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |