Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: CGI::Application and subroutines

by johnnywang (Priest)
on Dec 11, 2005 at 07:42 UTC ( #515798=note: print w/replies, xml ) Need Help??

in reply to CGI::Application and subroutines

as was pointed out earlier, you're throwing away the error message. If you want to show "here1:", try:
sub save_subsrbr { my @errors = qw(incorrect wrong); if (@errors) { my $err = errorhandler (\@errors); return "$err, here2: " . Dumper(@errors); } }

Replies are listed 'Best First'.
Re^2: CGI::Application and subroutines
by bradcathey (Prior) on Dec 11, 2005 at 18:37 UTC

    Thanks johnnyywang and Kanji, I think I get it now. The fact that return was printing my html page had me thinking it was replacing print (since you're not to be using the latter without care). But I'm learning that return is simply doing what returns always do. I guess I need to peak under the hood and see exactly where the C::A source code is outputing my page.

    Before C::A in my life, I would just exit through my errorhandler routine by print $output. But it looks like I have to be more tidy and "return" gracefully.

    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://515798]
[Discipulus]: hi Tux and good morning you and all!
[Discipulus]: I read about stack size of the tk cb program: have you tried the MCE version? -mce on command line
[msh210]: wow... talk about overkill... seeking a Perl way to split a file by size while ending on a line ending, and only then discovered that split -C will do it

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2017-09-20 07:00 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (234 votes). Check out past polls.