Thanks Shlomi, it's clear to me about the umask() now.
Regarding the perl version, I am using the perl come with the Suse Linux
in my company. Will it be a big job to update the Perl and making sure
other installed modules (dependencies) working fine? Can you please
guide me to some good resources on how to do it? Or can I only reinstall
the GD distribution and how? Thanks heaps.

Regards,
Kenneth 



-----Original Message-----
From: Shlomi Fish [mailto:shlo...@iglu.org.il] 
Sent: Wednesday, March 31, 2010 5:18 PM
To: beginners@perl.org
Cc: CHAN, KENNETH 1 [AG/7721]
Subject: Re: function umask() and problem in GD::image->png

Hi Kenneth,

On Wednesday 31 Mar 2010 11:34:37 CHAN, KENNETH 1 [AG/7721] wrote:
> Hi all,
>   I have 2 simple questions (maybe be very trial):
> 1. I saw some code put "umask 022;" in the near beginning of perl
> script. I understand that umask is for changing the file permission in
> unix/linux. However, if I put "umask 002" in the beginning of a perl
> script, after execution, the file permission is not changed to 002. So
> what is the purpose of using this command in perl since it does not
> change the actual file permission?

Actually, the umask affects permissions of the files created in the
future, 
such as with http://perldoc.perl.org/functions/open.html . See:

http://en.wikipedia.org/wiki/Umask

> 2. I tried the simple example in the GD.pm documentation:
> http://search.cpan.org/~lds/GD-2.35/GD.pm
> Perl shows me the errors on the line of "print $im->png;": Can't
locate
> object method "png" via package "GD::Image" .....
> The perl version in the server is: v5.8.8
> What is the problem? And how should I debug it?
>   Thanks in advance.

Since the "use GD;" did not fail, I guess you have GD.pm but the GD 
distribution was not installed properly. The GD distribution should work
on 
perl-5.8.8, although perl-5.8.8 is pretty old (and buggy). What is your
OS, 
distro, how-did-you-install-perl, etc.? Maybe you've missed some C
libraries 
when installing the GD distribution (such as libpng).

Regards,

        Shlomi Fish

> 
> Regards,
> Kenneth
> 

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

Deletionists delete Wikipedia articles that they consider lame.
Chuck Norris deletes deletionists whom he considers lame.

Please reply to list if it's a mailing list post - http://shlom.in/reply
.


---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and 
is intended to be received only by persons entitled to receive such 
information. If you have received this e-mail in error, please notify the 
sender immediately. Please delete it and all attachments from any servers, hard 
drives or any other media. Other use of this e-mail by you is strictly 
prohibited.


All e-mails and attachments sent and received are subject to monitoring, 
reading and archival by Monsanto, including its subsidiaries. The recipient of 
this e-mail is solely responsible for checking for the presence of "Viruses" or 
other "Malware". Monsanto, along with its subsidiaries, accepts no liability 
for any damage caused by any such code transmitted by or accompanying this 
e-mail or any attachment.
---------------------------------------------------------------------------------------------------------


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to