The UNIX and Linux Forums  


Go Back   UNIXおよびLinuxフォーラム > トップフォーラム > シェルプログラミングとスクリプティング
Googleのunix.com



シェルプログラミングとスクリプティング KSH 、 CSH 、 shに、 bashの、はPerl 、 PHPは、削除するsed 、 Awkの、他のシェルスクリプトやシェルスクリプト言語についての質問の投稿はこちら。

その他のUNIXおよびLinuxフォーラムトピックは参考にすること
スレッド スレッドスターター フォーラム 返信 最後の投稿
Newbi -ダウンロードしたコードと、適切な理解 mpinto UNIXのダミー質問と回答のため 2 2008年12月24日 10:48午前
のUnixへの初心者です。このコードを理解する上で助けplz 。 gokulj UNIXのダミー質問と回答のため 1 2008年12月23日 05:29午前
いとも簡単にいくつかのコードを理解する... NycUnxer UNIXのダミー質問と回答のため 2 2007年10月31日 09:20午前
どのようにしてC + +の自分自身のプロトコルを実装するための形式( Cコード)コードの準備 amitpansuria 高レベルのプログラミング 1 2007年9月7日 12:09午前

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek を搭載 Powered by Google
 
LinkBack スレッドツール このスレッドを検索 評価: Thread Rating: 1 votes, 2.00 average. 表示モード
  #1固定リンク)  
Old 2009年3月19日
Raheelハッサン Raheel Hassan is offline
登録ユーザー
  
 

参加日: 2009年3月
記事: 1
thisperlコードを理解する上で助けが必要です。

任意のコードを私は与えられたボディラインの下に理解する上での困難があると説明


私の$エラー\u003d "の/ var / log / controler.log " ;

& initLanguage ( $言語) ;
& launchCbox ( ) ;
サブlaunchCbox (

$ scr \u003d期間: : ScreenColor - >新;
$ scr - > clrscr ( ) ;
私の( $モード) \u003d @ _ ;
私の$エラー\u003d 0 ;
私の$ cbox_x \u003d $ dog_x + 3 ;

私の$ args ;
私% box_args \u003d % ( $ args [ 3 ] ) ;
$ args .\u003d " - D "はbox_args場合、 $ ( " " )デバッグ;
$ args .\u003d " - L "の場合、 $ box_args ( " " )ログ;
$ args .\u003d " - L "を。 box_args $ ( "言語" ) $ box_args ( "言語" ) ;

もし( $モード北東" " ) ( scr $再起動- > ( $ y_pos 、 3 ) - >を置く( $ Xの" 。 " 。 $ txth - > gettextの( " 5016 " ) ) ; )
他y_pos \u003d $ ( $ dog_y_pos +3 ; $ scr - > ( $ dog_y_pos +3,3 ) - >を置く( $ cbox_x 。 " 。 "です。 $ txth - > gettextの( " 5016 " " " × ( $ status_bar_pos - (長さ( $ txth - > gettextの( " 5016 " ) ) +7 )))); )

( ! $ xwindow ) ( `perlの 。 / cbox.pl 2 > >の/ var / log / $ args cbox.log > / dev/tty9 ` ; )
他( `perlの 。 / cbox.pl 2 > >の/ var / log / $ args cbox.log > / dev/pts/2 ` ; )
$エラー? & printNOK : &printOK;



くれぐれもよろしく、
Raheel 。
  #2固定リンク)  
Old 2009年3月19日
pludi's Avatar
pludi pludi is online now Forum Staff  
モデレータ
  
 

参加日: 2008年12月
場所: 。で
投稿数: 1937
今日のヒント: "を使用して[コード] [ /コード]タグ(サンセリフのスペース) 、または高度なエディタでは、 ' # '記号は、ソースを他のユーザーが読める以上のリストです。 "

それは、グローバル変数に大きく依存しており、私は、このコードが何をしているかもしれないが、推測できるという。

コード:
my $errorlog = "/var/log/controler.log";

&initLanguage($language); # I18N / L10N?
&launchCbox();

sub launchCbox {

    $scr = Term::ScreenColor->new; # Enable us to use pretty colors and
                                   # positioning on the terminal
    $scr->clrscr(); # Clear the screen
    my ($mode) = @_;
    my $error  = 0;
    my $cbox_x = $dog_x + 3; # Global. Source unknown. Meaning
                             # unknown.

    my $args;
    my %box_args = %{ $args[3] }; # Same as above
    $args .= "-d "                         if $box_args{"debug"};
    $args .= "-l "                         if $box_args{"log"};
    $args .= "-L " . $box_args{"language"} if $box_args{"language"};

    if ( $mode ne "restart" ) {
        
        # Print at line $y_pos, column 3 of the terminal the translation with
        # the key 5016 (whatever that is)
        $scr->at( $y_pos, 3 )->puts( $x . ". " . $txth->getText("5016") );
    }
    else {
        $y_pos = $dog_y_pos + 3; # Globals again
        $scr->at( $dog_y_pos + 3, 3 )->puts(
            $cbox_x . ". "
              . $txth->getText(
                "5016"
                  . " " x (
                    $status_bar_pos - ( length( $txth->getText("5016") ) + 7 )
                  )
              )
        ); # Write at position $dog_y_pos+3, 3 the content of $cbox_x,
           # the translation for key 5016, and a space (' ') times
           # the position of the status bar minus (about) the length of
           # text #5016
    }

    if ( !$xwindow ) { # If a xterm (or similar) is there, write to one
                       # hardcoded TTY, to another hardcoded TTY otherwise.
                       #Either way call cbox.pl
        `perl ./cbox.pl 2>>/var/log/cbox.log $args > /dev/tty9`;
    }
    else { `perl ./cbox.pl 2>>/var/log/cbox.log $args > /dev/pts/2`; }
    $error ? &printNOK : &printOK;

}

もし私は、このコードは、コード生成ユーティリティを使用し、好きな機能よりも外見を意識している誰かによって書かれたものでしょうね推測していた。
Closed Thread

ブックマーク

スレッドツール このスレッドを検索
このスレッドを検索

高度な検索
表示モード このスレッド
このスレッド

投稿ルール
あなた ことができない。 新しいスレッドを投稿
あなた ことができない。 返信の投稿
あなた ことができない。 添付ファイルの投稿
あなた ことができない。 自分の投稿を編集

BBコード なる 〜の上に
スマイリー なる 〜の上に
[イメージ] コードは 〜の上に
HTMLコードは、 オフ
トラックバック なる 〜の上に
ピングバック なる 〜の上に
Refbacks なる 〜の上に




すべてGMT -4です。現在の時刻は 05:48午前


提供: vBulletin、著作権© 2000 - 2006、Jelsoft企業株式会社。言語翻訳による電源
vBCredits v1.4著作権© 2007 - 2008 、 PixelFXスタジオ
は、 UNIXおよびLinuxフォーラムのコンテンツ著作権© 1993 〜 2009 。すべての権利を管理しReserved.Ad RedTyger

コンテンツ関連のURLで vBSEO 3.2.0