Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
    0: #!/usr/bin/perl
    1: 
    2: #yooz meee
    3: 
    4: my $fntd = `figlet -I2`;           #this is 4linux
    5: #my $fntd = "/pip/4dos/fig/fonts";  #this is 4dos
    6: 
    7:    chomp ($fntd);
    8:    $fntd .= "/*.flf";
    9: my $text = "@ARGV";
    10: my $outf = "dfaltout.txt";
    11: my @fntz = glob("$fntd");
    12: my $coun = 0;
    13: my $favs = " ";
    14: my $optn = "";
    15: my $inpt = "";
    16: 
    17: print "                       Tigger's Figlet Chooser v0.2\n";
    18: print "USAGE:  me\@myserver:\% perl tiglet.pl \"KakA NachoZ\"\n";
    19: print "Tiglet lets you interactively select the perfect figlet font \n";
    20: print " for your .sig or msg or title or... =) smiley!  \n";
    21: print "Please email suggestions or constructive criticisms to pip\@binq.org\n";
    22: print "n or Enter - checks next font, p - checks previous font\n";
    23: print "  Any specific number jumps directly to that font\n";
    24: print "t - prompts for text change, e - prompts for filename to export to\n";
    25: print "Y - SAVES selected text to specified exportfile and quits\n";
    26: print "Q - QUITS without saving, ... the parameters are not case-sensitive\n";
    27: print "Toggles: s=squish, k=kern, o=overlap, c=center, l=left, r=right, f=favorite\n";
    28: 
    29: if ($text eq "") {
    30:     $text = "KakA NachoZ";
    31:     print "Please enter text to display [$text]: ";
    32:     chomp ($poop = <STDIN>); if ($poop ne "") { $text = $poop; }
    33:     print "Please enter a file to write selected text to [$outf]: ";
    34:     chomp ($poop = <STDIN>); if ($poop ne "") { $outf = $poop; }
    35: }
    36: while ($inpt !~ /q|x|y|d/i && $coun < @fntz) {
    37:     $fntz[$coun] =~ s!.*/!!;
    38:     $kaka = `figlet -f $fntz[$coun] $optn $text`;
    39:     print "${kaka}Font\#$coun:$fntz[$coun],Text:$text,Optn:$optn,Favs:$favs,cmd[npyteskocq]: ";
    40:     chomp ($inpt = <STDIN>); $inpt =~ tr/A-Z/a-z/;
    41:     if ($inpt =~ /f/) { 
    42:         if ($favs =~ / $coun /) { $favs =~ s/ $coun / /; } 
    43: 	else { $favs .= "$coun "; } 
    44:     }
    45:     if ($inpt eq "" || $inpt =~ /n/) { $coun++;
    46:         if ($coun == @fntz) { print "Last Font Displayed!  Loop back to beginning? (y/n) ";
    47:             $poop = <STDIN>; if ($poop =~ /y/i) { $coun = 0; }
    48:         }
    49:     }
    50:     if ($inpt =~ /p/) { $coun--; }
    51:     if ($inpt =~ /\d+/) { $coun = $inpt;
    52:         if ($coun < 0) { $coun = 0; }
    53:         if ($coun > @fntz) { $coun = $#fntz; }
    54:     }
    55:     if ($inpt =~ /y/ || $inpt =~ /d/) {
    56:         print "Saving to $outf and Quitting!\n";
    57:         open OUTF, ">$outf"; print OUTF $kaka; close OUTF;
    58:     }
    59:     if ($inpt =~ /t/) { 
    60:         print "New Text [$text]: "; chomp ($poop = <STDIN>);
    61:         if ($poop ne "") { $text = $poop; }
    62:     }
    63:     if ($inpt =~ /e/) { 
    64:         print "Export File [$outf]: "; chomp ($poop = <STDIN>);
    65:         if ($poop ne "") { $outf = $poop; }
    66:     }
    67:     if ($inpt =~ /s/ || $inpt =~ /k/ || $inpt =~ /o/ ||
    68:         $inpt =~ /c/ || $inpt =~ /l/ || $inpt =~ /r/) {
    69:         if ($optn =~ /-$inpt /i) { $optn =~ s/(-$inpt |$inpt)//gi; }
    70:         else { $optn .= "-$inpt "; }
    71:     }
    72:     if ($inpt =~ /q/ || $inpt =~ /x/) { print "Quitting Without Saving!\n"; }
    73: }
    

In reply to This is Tiglet! by PipTigger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found