| Win32-Unicode documentation | Contained in the Win32-Unicode distribution. |
Win32::Unicode::Error - return error message.
use Win32::Unicode; mkdirW($exists_dir) or dieW errorW
Wn32::Unicode::Error is return to Win32API error message.
get last error message.
Yuji Shimada <xaicron@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Win32-Unicode documentation | Contained in the Win32-Unicode distribution. |
package Win32::Unicode::Error; use strict; use warnings; use 5.008003; use Carp (); use Exporter 'import'; our $VERSION = '0.25'; use Errno qw/:POSIX/; use Win32::Unicode::Constant; use Win32::Unicode::Util; use Win32::Unicode::XS; # export subs our @EXPORT = qw/errorW/; our @EXPORT_OK = qw/error/; our %EXPORT_TAGS = ('all' => [@EXPORT, @EXPORT_OK]); my %ERROR_TABLE = ( &ERROR_FILE_EXISTS => EEXIST, ); sub errorW { my $buff = foramt_message(); $buff = utf16_to_utf8($buff); $buff =~ s/\r\n$//; return $buff; } sub _set_errno { my $errno = $_[0] ? set_last_error($_[0]) : get_last_error(); $! = $ERROR_TABLE{$errno} || $errno; return; } *error = *errorW; 1; __END__