luc said:
This program runs perfect when i execute it in dos in the perl directory.
But when i run it in a perl editor(perlide) it does nothing. Does anybody
know why?
print "Please tell me your name: ";
$name=<STDIN>;
chop $name
print "Thanks for making me happy, $name !\n"
Never heard of "perlide" but generally speaking, you could try to disable
buffering. Also use chomp() in stead of chop() and finally, always (and I
really mean *always*) use strict ! Did you copy-paste the code or re-type
it 'cause there was a missing ; in the chop $name and print "..." lines.
So the improved code is something like this;
#!/usr/local/bin/perl -w # just a habbit
use strict; # always use this - check the
documentation for the details
use warnings; # optional and the same as perl -w
$| = 1; # disable buffering
print "Please tell me your name: ";
my $name=<STDIN>; # must use my() because of use strict;
chomp $name; # chomp() only removes \n when necessary
print "Thanks for making me happy, $name !\n";
This looks like one of your 1st scripts. Just keep going and don't forget to
read (or at least scan) the FAQs of both Perl and Perlide.
Good luck,
Stefan