All pastes #264406 Raw Edit

Stuff

public text v1 · immutable
·published 2006-12-02 11:35 UTC
rendered paste body
bash2-2.05b$
cat pe       cat perl.pl
cat: perl.pl: No such file or directory
bash2-2.05b$ cat ~/lblmarker/perl.pl
cat: /home/skorm/lblmarker/perl.pl: No such file or directory
bash2-2.05b$ cat ~/lblmaker/perl.pl
#!/usr/bin/perl
use Getopt::Std;
my $opt_string = 't:m:M:b:B:f:F:';
getopts( "$opt_string", \%opt );
$title = $opt{t};
$message =   $opt{m};
$message2 =   $opt{M};
$field1 =  $opt{f};
$field2 =  $opt{F};
$button1 =   $opt{b};
$button2 =   $opt{B};
$starta = "+-[\026" ;
$side = "+";
$enda = "\026]" ;
$fillera = '-';
$endb = '+';
$fillerb = $fillera;
$notxt = 0;
if ($message){
$notxt=1
}
if ($message2){
$notxt=1
}
if (length($message)>length($message2)){
        $fullsize = length ($message);
        for ($count=length($message2); $count<$fullsize; $count++)
        {
                $message2 = $message2 . " ";
        }
}else{
$fullsize = (length ($message2));
$fullsize = length ($message2);
for ($count=length($message); $count<$fullsize; $count++)
{
$message = $message . " ";
}
}
if ($fullsize < length($title) + 6 ) {
$fullsize = length($title) + 6;

for ($count=length($message); $count<$fullsize; $count++)
{
$message = $message . " ";
}

for ($count=length($message2); $count<$fullsize; $count++)
{
$message2 = $message2 . " ";
}

}


$fillings = 1+length ($starta)+length ($enda)+length ($endb)+length ($title) - 6;
for ($count=$fillings; $count<$fullsize; $count++)
{
$fillerb = $fillerb . $fillera;
}
$top = $starta . $title . $enda . $fillerb . $endb;
$one = $side . " " . $message . " " . $side;

if ($button2) {
$bfill = " ";
for ($count = 5 + length($button1)+length($button2); $count<$fullsize; $count++)
{
$bfill = $bfill . " ";
}
$buttons = $side . $bfill . "[" . $button1 . "] [" . $button2 . "] " . $side
}else{
if ($button1){
$bfill = " ";
for ($count = 2 + length($button1); $count<$fullsize; $count++)
{
$bfill = $bfill . " ";
}
$buttons = $side . $bfill . "[" . $button1 . "] " . $side
}
}

$blfill = " ";
for ($count = -1; $count<$fullsize; $count++)
{
$blfill = $blfill . " ";
}
$bl = $side . $blfill . $side;

$elfill = "-";
for ($count = -1; $count<$fullsize; $count++)
{
$elfill = $elfill . "-";
}
$endl = $side . $elfill . $side;
if ($field1){
$fline1filla = " ";
for ($count = 3 + length($field1); $count<$fullsize; $count++)
{
$fline1filla = $fline1filla . " ";
}
$fline1 = $side . " " . $field1 . "[\026" . $fline1filla . "\026]" . " " . $side;
}
if ($field2){
$fline2filla = " ";
for ($count = 3 + length($field2); $count<$fullsize; $count++)
{
$fline2filla = $fline2filla . " ";
}
$fline2 = $side . " " . $field2 . "[\026" . $fline2filla . "\026]" . " " . $side;
}
print "$top\n";
print "$bl\n";
if ($notxt == 1){
if ($message){
print "$one\n";
$two = $side . " " . $message2 . " " . $side;
print "$two\n";
}
}
if ($field1){
print "$bl\n";}
if ($field1){ print "$fline1\n"; }
if ($field2){ print "$fline2\n"; }
if ($button1){print "$bl\n";}
print "$buttons\n";
print "$endl\n";
bash2-2.05b$