[ic] Usertag return value

Peter peter at pajamian.dhs.org
Thu Feb 5 23:05:23 UTC 2009


On 02/05/2009 10:47 AM, Grant wrote:
> I have a usertag that takes an image, resizes it, and writes it to the
> filesystem.  It then does this two more times for two more sizes.  It
> appears to be returning 0 if the last attempt at resizing and writing
> was unsuccessful and 1 if it was successful, regardless of how things
> went with the other two resizings and writings.  I tried appending the
> writings with:
> 
> || die "0";
> 
> but that kills the whole page.  What is the correct way to do this so
> I can evaluate whether or not the tag executed properly?

what you probably want is: || return 0;

That will cause the usertag to stop processing and return 0 on the first
failed attempt.  Alternatively if you want it to continue to try writing
the other files then do something like this:

my $return = 1;

write ... or $return = 0;
write ... or $return = 0;
etc...

return $return;



Peter




More information about the interchange-users mailing list