sub FT_OpenPM{ my ( $self, $devNum ) = @_; my $status = $self->{'FT_STATUS'}; my $handle = $self->{'FT_HANDLE'}; #import function my $fct_open = new Win32::API( 'FTD2XX', 'FT_Open', 'IP', 'I' ); unless( $fct_open ){ print("FT_Open not found!\n"); return 0; } #call imported function $status = $fct_open->Call( $devNum, $handle ); print "[$handle]\n"; $handle =~ s/\0.*$//; print "[$handle]\n"; #$handle = Storable::retrieve( $handle ); #return the functions return status and the handle return ($status, $handle);