#!/usr/bin/perl ############################# # Name: Clock-Tk.pl # Desc: Display Tk clock. ############################# use strict; use warnings; use Tk; my ($n,$mw); my $mw_width = 420; my $mw_height = 40; my $mw_left = 2570; my $mw_top = 20; $mw = MainWindow->new(); $mw->geometry("${mw_width}x${mw_height}+${mw_left}+${mw_top}"); $mw->bind('<Escape>' => sub {exit;}); $mw->optionAdd('*font','Courier 20 bold'); $mw->Label(-textvariable=>\$n,-background=>'lavender')->pack; $mw->repeat(100,sub{$n=scalar localtime time}); MainLoop();
I am running Strawberry Perl 5.24.1 on Windows 10. I copied the Tk clock one-liner that Discipulus put in Cool Uses for Perl and made it into a script, adding a "geometry" statement to place it where I want on the screen. The script runs fine. I converted the script to an executable using perl2exe Pro. The executable also runs fine.
The problem occurs when I start the executable in a cmd window with the "/b" option to free my cmd window to issue other commands. After entering "start /b Clock-Tk.exe" and pressing ENTER, I must press ENTER a second time before the program starts.
I have numerous other TK scripts that I have converted to executables using perl2exe Pro, and none of those require a second ENTER to start.
I cannot see what is unique to this program that is causing the problem. Does anyone have an idea what is causing this script to require a second ENTER in order to start?
Thanks."It's not how hard you work, it's how much you get done."
In reply to Tk Program Converted to Executable Requires 2 ENTERs to Run by roho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |