Mercurial > pub > Impl
comparison Lib/IMPL/Test/Straps/ShellExecutor.pm @ 0:03e58a454b20
Создан репозитарий
author | Sergey |
---|---|
date | Tue, 14 Jul 2009 12:54:37 +0400 |
parents | |
children | 16ada169ca75 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:03e58a454b20 |
---|---|
1 package IMPL::Test::Straps::ShellExecutor; | |
2 use strict; | |
3 use warnings; | |
4 | |
5 use base qw(IMPL::Object IMPL::Object::Serializable); | |
6 | |
7 if ($^O =~ /win32/i) { | |
8 require Win32::Console; | |
9 } | |
10 | |
11 sub Execute { | |
12 my ($this,$file) = @_; | |
13 | |
14 my $h; | |
15 | |
16 if ($^O =~ /win32/i) { | |
17 Win32::Console::OutputCP(65001); | |
18 unless ( open $h,'-|',$file ) { | |
19 return undef; | |
20 } | |
21 binmode $h,':encoding(utf-8)'; | |
22 } else { | |
23 unless ( open $h,'-|',$file ) { | |
24 return undef; | |
25 } | |
26 } | |
27 | |
28 return $h; | |
29 } | |
30 | |
31 | |
32 1; |