June 2010 Archives

Read (the perldoc) carefully

Another day in CGI/CGI::Application brought me another question.

My code:

    ... ...
    $out .= $cgi->hidden('rm', 'mode2');
    ... ...
    return $out;

Seems to be OK, just like the example code below, a little bit different though:

$output .= $q->hidden(-name => 'rm', -value => 'mode2');

And if I use a URL like this: "http://www.example.org/cgi-bin/page.cgi?rm=whate…

The last statement

Days ago, I was learning to use CGI::Application.

After finished my baby "run mode", I opened my browser to give it a shot. It worked, and I start wondering why it worked. The last statements of those examples are

return $output;

Mine's not, it looked like this(I forgot to add "return" by accident):

sub run_mode_1 {
    my $self   = shift;
    my $query  = $self->query();
    my $output = q[];
    ... …

About pid

user-pic I blog about Perl.