Several suggestions:
Here's my offering:
#!/usr/bin/perl -spi
use strict;
use vars qw( $gif $blink );
my $files;
BEGIN {
unless ((defined $gif or defined $blink) and @ARGV) {
(my $exec = $0) =~ s!.*/!!;
exit warn "usage: $exec [ -gif=[1|0] ] [ -blink=[1|0] ] files...\n
+";
}
$files = "@ARGV";
}
if (defined $gif) {
if ($gif) { s/ANIMEXTZ1\.0/ANIMEXTS1.0/, s/NOTSCAPE2\.0/NETSCAPE2.0/
+ }
else { s/ANIMEXTS1\.0/ANIMEXTZ1.0/, s/NETSCAPE2\.0/NOTSCAPE2.0/ }
}
if (defined $blink) {
if ($blink) { s/blynk/blink/ }
else { s/blink/blynk/ }
}
END {
printf "Animated GIFs are %sabled in $files\n",
("dis","en")[$gif] if defined $gif;
printf "Blinking text is %sabled in $files\n",
("dis","en")[$blink] if defined $blink;
}
I'll comment on (or explain) the code as requested.
$_="goto+F.print+chop;\n=yhpaj";F1:eval
-
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.
|