Hi all,

 

I’m using Win32::GUI::BitmapInline and I have just one problem with it: the requirement that my script have write access to the current directory. Here’s my question: could I simply modify the code in the BitmapInline.pm file (located in “C:\Perl\site\lib\Win32\GUI”) so that write access to the current directory is not a requirement? Consider the following code in BitmapInline.pm:

 

sub new {
    my($class, $data) = @_;
    open(BMP, ">~$$.tmp") or return undef;
    binmode(BMP);
    print BMP MIME::Base64::decode($data);
    close(BMP); 
    my $B = new Win32::GUI::Bitmap("~$$.tmp");
    unlink("~$$.tmp");
    return $B;  
}

 

Could I simply change the 2nd, 6th, and 7th lines in the subroutine so that my script will write to the root of the C:\ drive (as an example) instead of the current directory (see below)?

 

sub new {
    my($class, $data) = @_;
    open(BMP, ">C:\\~$$.tmp") or return undef;
    binmode(BMP);
    print BMP MIME::Base64::decode($data);
    close(BMP); 
    my $B = new Win32::GUI::Bitmap("C:\\~$$.tmp");
    unlink("C:\\~$$.tmp");
    return $B;  

}

 

If this change will work, would it require me to re-compile Perl or do anything else special?

 

Thanks,

Rob