[ic] Usertag return value

Grant emailgrant at gmail.com
Fri Feb 13 02:15:49 UTC 2009


>>>> $return= $image->Write(filename=>'/file/location/'.$name.'_image.jpg')
>>>> or return 0;
>>>> $Tag->log("1: return=$return error=$!");
>>>> $return= chmod(0644,"/file/location/".$name."_image.jpg") or return 0;
>>>> $Tag->log("2: return=$return error=$!");
>>
>> Why not write it like this:
>>
>> return 0
>>    if ! $image->Write(filename=>'/file/location/'.$name.'_image.jpg');
>>
>> return 0
>>    if ! chmod(0644,"/file/location/".$name."_image.jpg");
>
> unless (chmod(...)) {
>      return 0;
> }

I tried switching to this with the same results.

- Grant


> is much more readable and you can also capture the return value with:
>
> unless ($ret = chmod(...)) {
>      return 0;
> }
>
> Regards
>           Racke



More information about the interchange-users mailing list