A quick test on a windows machine with strawberry perl shows that the &#39;PROMPT&#39; environment variable gets set when run by the command line but doesn&#39;t when double clicking (with windows set to open a pl file via the perl.exe directly)<br>

<br><div>I&#39;m not sure how reliable that is across different system configurations, but might be a lead worth following.</div><div><br></div><div><br></div><div><div class="gmail_quote">2010/12/10 Reuben Settergren <span dir="ltr">&lt;<a href="mailto:ruberad@gmail.com">ruberad@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Hi Mongers,</div>
<div> </div>
<div>I&#39;m writing some simple scripts for some very command-line-phobic users; or let&#39;s just say they would prefer a mousy solution over a typey solution.</div>
<div> </div>
<div>I&#39;ve already made the script do useful things with no arguments, so they can keep the script on their desktop, paste it into any directory and double-click it, and then the script will discover input files in that directory with glob() and do its thing.</div>




<div> </div>
<div>I&#39;ve also come up with some clever (but probably not original) techniques like checking the special variable $0 (that&#39;s a zero) for _test or _verbose, so I can tell if they changed the filename, and then I can behave as if they had run from the command line with the equivalent switches, and hold up the cmd window at the end with &quot;Press &lt;enter&gt; to close this window&quot;.</div>




<div> </div>
<div>But I&#39;m looking for ways to make it even more idiot-proof.</div>
<div> </div>
<div>Does anybody know of a way that I can tell whether my script was invoked from the command-line or by double-clicking? (other than checking $0 and trusting that the user will never double-click the script meant for command-line invocation?)</div>




<div> </div>
<div>Is there any way to package up a perl script (or .bat?) such that input file(s) can be selected with the mouse, and dragged into the icon for the script, so that the script would then run with the (full?) paths to the selected files as its command-line arguments? (This is a mac paradigm, right? I&#39;ve never seen this on windoze or unix)</div>




<div> </div>
<div>Also open to other clever ideas you may have to offer...</div>
<div> </div>
<div>thx,</div>
<div> </div><font color="#888888">
<div>r</div>
</font><br>_______________________________________________<br>
San-Diego-pm mailing list<br>
<a href="mailto:San-Diego-pm@pm.org">San-Diego-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/san-diego-pm" target="_blank">http://mail.pm.org/mailman/listinfo/san-diego-pm</a><br></blockquote></div><br></div>