Perl format number

This is a little script to format numbers in Perl:

This is our result:

Perl format string to the same size

This little Perl-function formats some strings to the same length.

We could see the normal output then the formatted strings:

Perl Formater for Terminal and HTML

If you want to bring your “ps” or another tabel in a good format you could use this skript:

Here we have a good terminal format:

This is the raw HTML output:

And in the browser it looks pretty like this :

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 782116 56436 ? Ssl 14:22 0:03 –NONE–
root 7 0.0 0.0 11728 1348 pts/0 Ss 14:22 0:00 sh
root 61 0.0 0.0 19740 1212 pts/0 R+ 15:44 0:00 ps

Perl simple Code formater

I wrote just for fun a litte perl code formater, so  if you want to format your code you could use this snippet:

The result from a single line code is this :

It was build for little subs so its possible that your big code is not formatted very well.