Hi Paul,
Paul Vixie wrote: > Raymond Wan <r...@kuicr.kyoto-u.ac.jp> writes: > >>>>> if (not $success) { >>>>> return $m->comp('/BAR', %ARGS); >>>>> } >>> "return" as shown here does nothing to the output that was already sent by >>> the components called before this one (for example your preamble/headings), >>> and does nothing to prevent the component who called this one from sending >> Thank you for your explanation! I never knew about the difference >> between the two. Actually, I never knew that "return" could take a URL >> as an argument. > > return isn't taking a URL as an argument. in fact the function's return > value is meaningless, and the real intent is to call $m->comp() and then > immediately return. this: > > if (not $success) { > return $m->comp('/BAR', %ARGS); > } > > is shorthand for this: > > if (not $success) { > $m->comp('/BAR', %ARGS); > return; > } Ah, thank you! I mean the equivalence between the two sets of statements is surely not a Perl-thing but something introduced by Mason? [Of course, nothing wrong with that...so is the notion of components and many other things.] But yes, I see what you mean and thanks a lot -- I wouldn't have figured that out and was just going to accept that Mason's version of return is taking a URL as an argument... Ray ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users