Padre 0.84 – for “Purim” in Hebrew and Arabic

In the last month I got involved in translating Padre – the Perl IDE (== programmers editor ). 

Padre, the Perl editor
Padre, the Perl editor
The Help –> “About” window – both in Hebrew and in Arabic – have the text reverse. This is very funny :-).
The Padre 0.84 appears as: 48.0 erdaP

This perfectly suits the atmosphere of today’s holiday.

Today is the Jewish holiday of Purim (Hebrew: פּוּרִים) – and many of us (here in Israel) are wearing masks and costumes,  and feel happier than usual.
So I think it will be just nice to show Padre in its Hebrew and Arabic “mask”. 

And … since I love Padre (of course) – I hope to fix it!
Hebrew Padre

Padre 0.84 - Hebrew 01
Padre 0.84 - Hebrew 01
Padre 0.84 - Hebrew 02
Padre 0.84 - Hebrew 02
Arabic Padre 0.84

Padre 0.84 - Arabic
Padre 0.84 - Arabic
And now – reversed text in the “About”, Hebrew and Arabic

Padre 0.84 - Hebrew About
Padre 0.84 - Hebrew About
Padre 0.84 - Arabic About
Padre 0.84 - Arabic About حول بادره
Persian:
And — last one, just for fun, in Persian / ( فارسی == Fārsi ) / Iranian. 

This is because the biblical Book of Esther (Megillat Esther) – which is read in this holiday – is set in the third year of Ahasuerus / Xerxes, the king of ancient Persia.
Persian Padre :

About Padre - Persian
Padre - Persian

Search many PPM’s (ActivePerl packages) and printing multi line results into a file

I want to search many PPM’s (ActivePerl packages) and printing multi line results into a file.

This is Windows XP PC, using ActivePerl 5.10.0 Build 1004.

So I have the file “require_for_padre.txt” which contains all the Perl modules needed for Padre.

I took the names from:
http://svn.perlide.org/padre/trunk/Padre/Makefile.PL

and put each after the search query of ActiveState PPM, as follows:
(Note – this is for running from DOS):

ppm search App::Ack
ppm search Carp
ppm search Class::Adapter
...
ppm search Test::Exception
ppm search Test::NoWarnings
ppm search Test::NeedsDisplay

Now I wand to read all the above –  and put the output –  which is multi line per each search – into a text file.

Here’s the way:

=======================================

#!/usr/bin/perl -w
use strict;
use Cwd;
use File:: Path;

my $cur_dir = getcwd();
my $pkg_file = "require_for_padre.txt";
my $dest_file = "ppm_output_for_padre.txt";

my $line = "";
my $ppm_search_line = "";
my $total_lines = 0;
my $actual_lines = 0;

## my $cur_line = 0;

## Get the answer for the  ppm search:
  my $get_ppm_search_answer = "";

opendir(DIRHANDLE, "$cur_dir") or die "couldn't open $cur_dir: $!";

print "Openned  $cur_dirn";

  open (PKG_FILE, "$pkg_file") or die "couldn't open $pkg_file: $!";

  print "Openned  $pkg_filen";
  print "----------------------------------------------------------n";

  # create a blank file
  open (DST_FILE, ">$dest_file");
  close (DST_FILE);

  print "tttcreated $dest_filen";
  print "----------------------------------------------------------n";

  open (DST_FILE, ">$dest_file");

  while (<PKG_FILE>) {
       $total_lines = $total_lines +1 ;
       ##    $cur_line = 0;
       my $ppm_search_line = $_;
       #print "nnnn$line $total_lines :t $linen";

       print "$ppm_search_line";

       #system("$ppm_search_line");

       print for qx{$ppm_search_line};
       }

        close (DST_FILE);
  close (PKG_FILE);

closedir(DIRHANDLE);

print "$total_lines are: $total_lines n";

=======================================

That’s it

How to run?

Well… :

N:OrenMperl_ppm>ppms_padre001.pl   ppm_output_for_padre.txt

using ExtUtils: : Packlist to uninstall Padre 0.26

I tried to upgrade my Padre (the Perl IDE) on MS-Windows and broke it – so now I want to remove Padre.

There is a Perl module named: “ExtUtils : : Packlist” – used for manage .packlist files.

There is an example – used remove ALL installed modules.

I mada a slight change – to remove only a specified module – for example Padre.

(Don’t worry – I’m going to re-install it later).

Here is the code:

————————————————————

#!/usr/local/bin/perl -w

 use strict;
 use IO:: Dir;
 use ExtUtils:: Packlist;
 use ExtUtils:: Installed;

 sub emptydir($) {
  my ($dir) = @_;
  my $dh = IO:: Dir->new($dir) || return(0);
  my @count = $dh->read();
  $dh->close();
  return(@count == 2 ? 1 : 0);
 }

 # Find all the installed packages
 print("Finding all installed modules...n");
 my $installed = ExtUtils::Installed->new();

 foreach my $module (grep(/^Padre/, $installed->modules())) {
 my $version = $installed->version($module) || "???";
 print("Found module $module Version $versionn");
 print("Do you want to delete $module? [n] ");
 my $r = <STDIN>; chomp($r);
 if ($r && $r =~ /^y/i) {
 # Remove all the files
 foreach my $file (sort($installed->files($module))) {
  print("rm $filen");
  unlink($file);
 }
 my $pf = $installed->packlist($module)->packlist_file();
 print("rm $pfn");
 unlink($pf);
 foreach my $dir (sort($installed->directory_tree($module))) {
   if (emptydir($dir)) {
    print("rmdir $dirn");
    rmdir($dir);
    }
   }
  }
 }

————————————————————

My (shameless) expectations from Padre for the future

Follow up to the post “Plans for the next month or two” of Gábor Szabó – here are My shameless expectations from Padre for the future.

This is a really great initiative to build a Perl IDE, which is Open-Source and written itself in Perl.
It looks that the development goes quite well, looking at the main Development site of Padre (padre.perlide.org), including the useful Wiki .

So… here are MY comments.

  1. Just for a first Note:
    I know that it might be a little rude because I didn’t actually contribute to the Padre code.
    I only tried to use it and even succeeded few times… 🙂
    But Gábor’s blog prefers that readers will comment on their own blog. So I write here what I would want from Padre.
    This is only some kind of a “wish list”.
    I hope I’ll be able to contribute with my minor experience.
  2. MS-Windows:
    Padre use Strawberry Perl. What about ActiveState Perl? ActivePerl 5.10.0 Build 1004
    I succeeded to install Padre 0.10 on MS-Windows XP PC with ActiveState Perl, by using “force”.
    I have now ActivePerl 5.10.0 Build 1004.

    But I can not install recent versions (0.19, 0.20) that seem to have many cool features.

    My recent post to Israel.pm Mailing List:
    [Israel.pm] Padre 19, MS-Windows, Active Perl (Compilation failed)
    and to the [Padre-dev] mailing list:
    [Padre-dev] [Israel.pm] Padre 19, MS-Windows, Active Perl (Compilation failed)

    The instructions written on the “Download” page of Padre for Windows with Active Perl are not working anymore for recent releases of Padre.
    Funny – I am mentionet there. Yeahhh…

  3. Linux Distributions and other Open-Source Operating Systems:
    From the Screen shots page I see pictures of Padre on Ubuntu and on OpenSUSE.
    I think I have seen somewhere that Gábor is working on Ubuntu, but I’m not sure…

    What about other Linux Distributions?
    Currently my home PC has Mandriva (this one was the quickest to detect my SATA hard-disks).
    Mandriva 2009.0 - This is what I use

    I have tried a long time ago – I promise to try installing again and report.

    What about other Open-Source Operating Systems?
    FreeBSD / NetBSD / OpenBSD ?
    OpenSolaris ?

With all my above complaints – I still think that a great work is being done.
I guess that as Padre will be published more – then a wider verity of Operating Systems and environments will be used.

Blogged with the Flock Browser