The UNIX and Linux Forums  

Go Back   Die UNIX-und Linux-Foren > Top Foren > Shell Programmierung und Scripting
.
Google unix.com



Shell Programmierung und Scripting Post Fragen zu ksh, csh, sh, bash, Perl, PHP, sed, awk und anderen Shell-Skripte und Shell-Scripting-Sprachen hier.

Mehr UNIX-und Linux-Forum Themen Vielleicht finden Sie hilfreiche
Faden Thread Starter Forum Antworten Last Post
Newbi - Die Download-Code und die ordnungsgemäße mpinto UNIX for Dummies Questions & Answers 2 12-24-2008 10:48 AM
bin ein Neuling auf Unix. plz helfen beim Verständnis dieses Codes. gokulj UNIX for Dummies Questions & Answers 1 12-23-2008 05:29 AM
Little Trouble Understanding Code ... NycUnxer UNIX for Dummies Questions & Answers 2 10-31-2007 09:20 AM
wie ich eine C + +-Code (C-Code) für die Umsetzung meiner eigenen Protokoll-Format amitpansuria High-Level-Programmierung 1 09-07-2007 12:09 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Suche diesen Thread Bewertung: Thread Rating: 1 votes, 2.00 average. Anzeige-Modi
  #1 (permalink)  
Old 03-19-2009
Raheel Hassan Raheel Hassan is offline
Registrierte Nutzer
  
 

Join Date: März 2009
Beiträge: 1
Brauchen Sie Hilfe im Verständnis thisperl Code.

Kann eine Einrichtung, erläutert die unter den gegebenen Code-Zeilen Ich habe Schwierigkeiten zu verstehen ist,


my $ ErrorLog \u003d "/ var / log / controler.log";

& initLanguage ($ language);
& launchCbox ();
Unter launchCbox (

$ scr \u003d Term:: ScreenColor-> new;
$ scr-> clrscr ();
my ($ mode) \u003d @ _;
my $ error \u003d 0;
my $ cbox_x \u003d $ dog_x + 3;

my $ args;
my% box_args \u003d% ($ args [3]);
$ args .\u003d "-d", wenn $ (box_args "Debug");
$ args .\u003d "-l", wenn $ (box_args "log");
$ args .\u003d "-L". ($ box_args "Sprache") if ($ box_args "Sprache");

if ($ ne Modus "neu starten") ($ scr-> at ($ y_pos, 3) -> puts ($ x. "".. $ txth-> getText ( "5016"));)
else ($ $ \u003d y_pos dog_y_pos +3; $ scr-> at ($ dog_y_pos +3,3) -> puts ($ cbox_x.. "". $ txth-> getText ( "5016". "" x ($ status_bar_pos - (length ($ txth-> getText ( "5016")) +7 ))));)

if (! $ XWINDOW) ( "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;

)

Mit freundlichen Grüßen,
Raheel.
  #2 (permalink)  
Old 03-19-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
  
 

Join Date: Dezember 2008
Lage:. Auf
Beiträge: 1962
Tipp des Tages: "Mit [code] [/ code]-Tags (ohne die Leerzeichen), oder der" # "-Symbol in der erweiterten Editor, um Ihren Source-Liste oder besser lesbar für andere."

Das heißt, ich kann nur vermuten, was dieser Code kann tun, da sie in hohem Maße von globalen Variablen.

Code:
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;

}

Wenn ich denke, ich würde sagen, dass dieser Kodex wurde von jemandem geschrieben, wie die Verwendung Versorgungs-und Code-Generierung ist mit mehr als Aussehen Funktion.
Closed Thread

Lesezeichen

Thread Tools Suche diesen Thread
Suche diesen Thread:

Erweiterte Suche
Anzeige-Modi Rate this thread
Rate this thread:

Forumregeln
Du möglicherweise nicht neue Themen
Du möglicherweise nicht nach Antworten
Du möglicherweise nicht post-Anlagen
Du möglicherweise nicht bearbeiten Sie Ihre Beiträge

BB-Code ist Auf
Smilies sind Auf
[IMG] Code Auf
HTML-Code ist Aus
Trackbacks sind Auf
Pingbacks sind Auf
Refbacks sind Auf




Alle Zeiten sind GMT -4. Es ist jetzt 09:21 AM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Ltd. Sprachliche Übersetzungen Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
Die UNIX-und Linux-Foren Content © Copyright 1993-2009. Alle Rechte Reserved.Ad Management von RedTyger

Content Relevant URLs durch vBSEO 3.2.0