Open dialogue with the naked version of Perl

I have a Perl installation for bare bones, and I would like to create a dialog box asking you to specify the folder and / or folder to run the script.

This is my working computer, and I need permission to install Perl - IT ignored my request (they did not deny it). I managed to find a truncated version of Perl installed with another program, and with that using a script. He had exactly 3 modules, and I added strict warnings.

I understand that there are modules for this (TK is the most popular), but they depend on other modules (AutoLoader, DynaLoader, ...), which probably depend on others. Sneaking up two modules in one: sneaking a dozen + is another.

Edit (bottom): Another complication. My immediate team members use my scripts, and they all have a simple Perl installation, because they all have a parent program. The first time someone uses one of my Perl scripts, I establish file associations and add strict and warning messages (so I don’t forget to comment on them). Thus, I would like to keep the mood as simple as possible.


Currently, all my scripts are running in the folder in which they are located. This becomes inconvenient due to changes in scenarios over time. My current plan is to use a command line prompt so that the user copies the file path from Windows Explorer and then parses it using a regular expression. I foresee a couple of problems with this:

  • Paste on the command line is annoying
  • Care must be taken when bridging network drives (C> G> N)
  • spaces / strange characters / slashes go the right way.
  • Make sure the script works in the "new" input location

This seems doable, but I wanted to see if there would be a more convenient way to do this (esp to get around the command line annoyance).

Hopefully the question is not too wide for this forum - if not, I will come back later with some programmed code.


OS: Windows 7 Professional (64 bit)

Perl: ActiveState version 5.6.0 (downloaded February 21, 2001)

Available modules: Exporter, RE, utf8, strict and warning. As a rule, this works quite well, since I usually do file manipulations.

+8
user-interface perl
source share
4 answers

You won't get much from the 13-year-old version of Perl, which may not even include all 5.6 modules. Is this an assumption of the Rational package that installed this version of Perl? If it is ClearCase, there is a program called clearprompt . You can try this.

I know that this is not what you want here, but forget about Perl and try it in PowerShell .

PowerShell is a used programming language created by Microsoft specifically for Windows. This is a complete programming language that integrates closely with Windows. He is very object oriented. It can display dialog boxes. And most importantly, this happens on all Windows XP machines. This means that if you are writing a PowerShell application, all of its colleagues can use it.

All my Powershell experience consists of three programs. I usually work in Unix / Linux environments and mostly server side. However, we had a client who needed a special script to monitor some processes and email support if these processes were not updated within a certain time frame.

In Perl, it would be cinch, but they did not have Perl or Python, and I was told that nothing could be installed on these systems. I had to use any tools that were already there, so PowerShell was my only choice.

Powershell, after all, worked very well and was not so difficult to pick up. My main problem is that all I could find was PowerShell 2 documentation, but the servers that the script was supposed to run on were using PowerShell 1. Even worse, my system has PowerShell 2, so I run the script in his system, and then discovered that he was not working on the client system. However, I got PowerShell support and still delivered the program on time.

If you know VB, PowerShell syntax should be familiar enough, but even if you are not familiar with VB, you should have no problem finding syntax if you have done object-oriented programming. So, as far as I like programming in Perl, you are in an environment that is very limited. You can also use the tools that the environment provides you.

+3
source share

Take a look at PAR::Packer . This will allow you to create standalone executables from Perl programs.

Perhaps the fact that all the modules you use are isolated from this single executable file and are not accessible to the whole system, it will make it easier for IT professionals to provide full permission for your specific script.

+1
source share

Truncated perl 5.6 will not have what you want to achieve your goal. The only option for perl 5.6 would be to select an already installed graphics library (or your own WinForms) and manually configure a clean perl interface to your API.

You can use a portable version of a programming language where you have some control, but I would never recommend working against your IT team. You must work together.

If you are running Windows 7, check out PowerShell. To achieve his goal, he must have much more opportunities for work.

0
source share

You can use Zenity or Wenity . Zenity is a small command-line program that displays a dialog box for a graphical user interface that you can interact with, and as soon as they type "OK", it gives an answer to STDOUT. Although Zenity itself can usually be convinced to work on Windows, it is not native, and therefore does not have the usual β€œlook” of Windows. Wenity is my free Zenity port for Windows and .NET, as a small standalone file with a zero .exe installation.

You can open the file open dialog like this:

 my $filename = `/path/to/zenity --file-selection --title="Select input file"`; chomp($filename); 

Wenity should work roughly the same.

0
source share

All Articles