Training, Open Source computer languages

This is page http://www.wellho.net/forum/Perl-Programming/System-c ... l2exe.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
System calls with perl2exe

Posted by almosthere (almosthere), 6 September 2002
Hello there!

Just wondering if anyone has experienced problems using system calls with the perl2exe conversion utility. I've read up on the documentation available and can't seem to find a solution...

The problem I have is definitely strange. I'm using a small program as a client to retrieve system information and forward it as parameters in a URL :

Code:
# Gather information about the computer / user
&gather_info(\%pc_info);

# Build the command
$command = $pc_info{'PC_IELOC'};

# Build the parameters
$param = ' "http://myurl.pl?"';

foreach $k(keys %pc_info) {
  $param.="$k=$pc_info{$k}&";
}

$param.="gathered=1&f_username=$pc_info{USER_NAME}\"";  
$command="\"$command\"";

# Execute
$result =`$command $param`;



This code works *fine* when interpreted using perl. It opens IE (the location of which is identified in the gather_info subroutine) with the parameters in place.

When I use perl2exe, however, to convert this to an exe file, it displays this message :

'c:\Program' is not recognized as an internal or external command, operable program or batch file

I've tried using the system() function as opposed to the `` method of making a system call, along with various other alternative quotes etc., but to no avail. I've also tried embedding cmd32.exe in the exe file (a switch for perl2exe) and had no luck.

Anyone have any ideas?

Thanks -

almosthere


Posted by admin (Graham Ellis), 6 September 2002
Not exactly a solution, but it does look to me as if some component or other is parsing your command line in a "shell like" manner, and is making a mess of
     c:\Program Files\etcetcect
because of the space after the word program.  I would be very tempted to try copying the appropriate program file to a different directory (one without a space in the name), and seeing if the thing then works.  OK - that might only provide a nasty temporary fix, but at least it'll help narrow the problem down.

Hey - if my experiement is practical, try it, post up the results, and then we can have a further look / thought having halved the problem!

Graham

Posted by almosthere (almosthere), 6 September 2002
Thanks..

Fascinating. I copied iexplore.exe to the C:\temp directory (i'm using windows 2000 pro. here) and tried it first with the perl interpreter... worked fine. Then I converted it with perl2exe and it gave me this message when run :

'The input line is too long.'

Now admittedly, the total length of the command is around 500 characters, but this worked *perfectly* using the Perl interpreter!

I'm starting to think maybe perl2exe has a few flaws in its conversion process...... surely this is atrocious? The input line blatantly isn't too long for IE (otherwise it wouldn't work normally) so which input line is it referring to? I haven't requested user input....

Maybe perl2exe isn't too au fait with system calls in Windows environments? If memory serves, it's a cross-platform utility. Hmm.

Almost






This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho