We can infer (it would have been nice to tell us) that you're on a Windows box. And we can infer either that you know very little about Perl and very little about using your CLI -- or that you are sufficiently expert to convert a script to an executable ... in which case you may stop reading here, since the rest of this reply won't address your problems at that kind of expert level.
But expertise seems unlikely.
So let's look further: the line of code you show is neither properly formatted for this site (use <code>...</code> tags around all code and data), nor terribly informative about what your full script may look like. (Knowing that might be helpful.)
However, guessing that you're doing something like:
C:\>perl -e "system("title Myperlscript.exe");"
Unfortunately, that produces this message:
syntax error at -e line 1, at EOF
So, you might wish to consider fixing your quotes to keep the windows shell happy:
>perl -e "system(\"title Myperlscript.exe\");"
which would cause something to flash in the title bar... very briefly.
However, that's not an answer to your (presumed) question (and it's wrong, anyway!), so moving away from guessing, the next bit of code would do what you ask (not quite so briefly):
perl -e "system(\"title foo\");sleep 5;"
which would change the title bar caption to "foo" ... for 5 seconds, which is a little short of "permanently" (and one hopes that is merely a careless phrase, since changing Mr. Gates' handiwork - permanently - is beyond the scope of this forum).
Another approach would be to use this:
perl -e "`title \"my script\"`;print 'enter: ';$x=<>;"
which would print enter: on your screen... and (ta da!) change the title bar caption from "Command Prompt" to "my script."
Woot!
Regrettably, as soon as you enter something the caption changes back to "Command Prompt."
However, if you're really interested in learning something from all this, see exec or (at your command prompt) try perldoc -q backticks and perldoc -f exec for relevant discussions.
And, oh yes, please read On asking for help, How do I post a question effectively?, I know what I mean. Why don't you? and Markup in the Monastery to learn what's expected of a SOPW.
Update: fixed typo in link to exec docs; thanks, AnomalousMonk!
|