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);
    }
   }
  }
 }

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

Yes! At last – Padre on Ms-Windows with ActivePerl 5.10.0 Build 1004

I’ve just succeeded to install Padre 0.25 on the Ms-Windows PC I have at work.

It wasn’t easy at all…

This PC is Windows XP with ActivePerl 5.10.0 Build 1004.

All the times that I tried in the past – I had many problems, including complicated needs to do compilation.

Now I have on it Microsoft Visual C++ 6.0 – maybe it helped solving dependency on modules that need local compilation.

Other things that I have just made and helped:

  1. upgrading last version of Encode – using ppm ,
  2. upgrade of Wx – also by using ppm ,
  3. installing Alien-wxWidgets (the same way),
  4. And now – again with ppm:
ppm install  --force Alien-wxWidgets-dev

(I use the PPM from DOS “command line” :-/)

And now – here are a few pictures of my Padre 0.25:

Padre 0.25 main Window
Padre 0.25 main Window
Padre 0.25 - menu
Padre 0.25 - menu
Padre 0.25 - menu
Padre 0.25 - menu

padre_0250900

Please note the reversed English letters on the help:

Padre 0.25 - Help
Padre 0.25 - Help
Padre 0.25 - About
Padre 0.25 - About

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

Why do I want an IDE for Perl

I was asked (Gabor – thanks) to explain why do I actually need an IDE for Perl.

The short answer is –
To run my little Perl/TK program from inside the editor, and Debugging.

Details:

  • First – a little background:
    I’m not an experienced programmer. I mean –  not in the sense of using major “heavy” languages like Java, C++/ C# or C and others.  (I know just a little of those… ).
  • Second – A specific example:
    I do know know some Perl and use it at my daily work – to process textual files.
    So I wrote a Perl/TK thing on my PC  – to process a textual bibliographic files and add certain fixed bibliographic fields.
    It’s Windows XP that I have at work.
    So for editing my scripts –  I use Vim, which is nice and colorful  just like in various Unixes .
    BUT For running – I currently use ActivePerl 5.10.0.1003 .

    The “coding” is separated from the code testing and debugging.

  • Now –  people around me at work use Visual Studio for C++ to develop a GUI application.
    So … Why won’t I use something like this to improve my little Perl/TK program?

    What I do now is trial and error:
    I edit the script / program in Vim but run it separately (done by ActivePerl when I double click it) and not from inside the editor.

And that’s where I need an IDE.

Vim is great – but IDE can stop the run in a breakpoint, so it saves a lot of debugging time.

Parade – an IDE in Perl for Perl

Gabor Szabo writes on his blog about  Padre, the Perl IDE

Gabor asks in the title  Who needs and IDE for Perl anyway?

Who needs it? Well … me!

But …Isn’t there a package for Mandriva?

I’m going to try to at least install it, on my new home PC – that has now Mandriva that I have just installed.

(My use of Mandriva now is quite new. I mean – I started with Mandrake but it was a long time ago. I’m used to Debian , but this is for another post)