in reply to Different meanings of $0 under the same operating system

Why such a complicated program? Does it give different output if you would have written:
#!/usr/bin/perl -w print "My name is $0...\n";
instead?

Replies are listed 'Best First'.
Re^2: Different meanings of $0 under the same operating system
by Jorge_de_Burgos (Beadle) on Nov 03, 2009 at 12:12 UTC
    Well, yes, of course I could have written a shorter program like yours. In that case the program would totally miss the output when run by Nautilus without a terminal open, wouldn't it? Just try to run your shorter program without a terminal.
      #!/usr/bin/perl -w print "My name is $0...\n"; <STDIN>;
      ...
        That won't work either. Can't you good die-hard command-line folks think of lack of feedback in a gui? That's what UI::Dialog is meant for... Just using print won't put anything on the gui if you run the program without a terminal as I wrote.