以下代码存为3.bat- @rem = '
- @echo off
- color 06
- echo.&echo.
- c:\perl\bin\perl.exe -S 3.bat
- goto end_perl
- : end_perl
- pause>nul
- exit
-
- @rem ';
-
-
- #!/usr/bin/perl
-
- use Win32::Console;
-
- my $Out = new Win32::Console(STD_OUTPUT_HANDLE) || die;
- $Out->Cursor( 20, 20,0,0 );
-
- my $n=0;
- while (1) {
-
- unless ($n>=11) {
- foreach (qw{ \\ | / - }){
- $Out->FillChar("$_", 100*80, 0, 0);
- select(undef,undef,undef,0.05);
- }
- }
- if ($n>=12 and $n <=24) {
- foreach (qw{ - / | \\ }){
- $Out->FillChar("$_", 100*80, 0, 0);
- select(undef,undef,undef,0.05);
- }
- }
- $n++;
- $n=0 if $n>24;
- }
复制代码
|