|
|
Choosing A Webhost: |
Re: perl trigger's ending with 1?: msg#00030version-control.clearcase.general
At 09:32 PM 6/10/2006, Bob Andriola wrote: Anthony Ettinger wrote: This is not quite correct. "Triggers", more properly "perl trigger scripts", and more generally "perl scripts", have no reason to end with 1; and they generally don't. The OP is probably getting confused with perl modules (as opposed to scripts) which do tend to end with 1;. The reason is given in "perldoc -f require": The file must return true as the last statement to indicate successful execution of any initialization code, so it's customary to end such a file with "1;" unless you're sure it'll return true otherwise. But it's better just to put the "1;", in case you add more statements. So a module must return true, meaning a non-zero value. A pre-op trigger script, in order to not abort the CC operation, must exit true meaning a zero value. Note that returning and exiting are different concepts and their polarity is reversed. Also, perl exit behavior is different from traditional shells. The default exit status of a shell script is that of the last command run whereas the default exit status of a perl script is always 0. This is why ending a script with 1; (or 437;) is meaningless; the exit status will still be zero unless "exit(n)" is called with n != 0. -David Boyce <============================================================ To unsubscribe, send email to majordomo-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx and put these words in the message body: unsubscribe cciug ============================================================>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: perl trigger's ending with 1?, Anthony Ettinger |
|---|---|
| Next by Date: | RE: perl trigger's ending with 1?, Bygland, Brian |
| Previous by Thread: | Re: perl trigger's ending with 1?, Anthony Ettinger |
| Next by Thread: | RE: perl trigger's ending with 1?, Bygland, Brian |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |