in reply to Two questions about CGI and format specifiers (was: Two questions)
Is there anyway that I can get around this with like a delay or something?
Can't tell without seeing a snippet of the code, sorry
How do I get NAMES to go to the browser/STDOUT?
Fast solution: use STDOUT instead of NAMES.
A little more elaborated solution: you could use IO::File, creating filehandle-like objects, like this:
use strict ; # please, do use IO::File ; my ($name1,$name2) ; my $fh = IO::File->new() ; $fh->fdopen(fileno(STDOUT),'w') or die "Cannot open STDOUT: $!" ; $fh->format_name('NAMES') ; # Write to STDOUT using $fh, like this foreach my $data ([qw(mama papa)],[qw(tick tock)],[qw(cip ciop)]) { ($name1,$name2) = @$data ; $fh->format_write() ; } # your format definition goes here format NAMES = @<<<<<<<< @<<<<<<<<< $name1 $name2 .
For more information see IO::File documentation, which will lead you almost immediately to IO::Handle docs.
Note that you could do this also with plain Perl, too. Anyway, I prefer the object-oriented approach, since it doesn't depend on things such select calls and $~ variables. Instead, $object->format_name('MYFORMAT') call binds MYFORMAT to the specified object, which I find so desirable :-)
Ciao!
--bronto
# Another Perl edition of a song:
# The End, by The Beatles
END {
$you->take($love) eq $you->made($love) ;
}
|
|---|