in reply to Press enter to exit
Hi Anonymous Monk,
Just one 'kobo' note in addition.
but it is not working because i presume this command
if ($fi eq \n )
Yes, you presume right, for
- Though there is \n, but it usage is not literal. Am sure you must have seen that it is used in a double quote like this "\n" in this case. See this for more.
After you have use chomp, your variable is no longer "\n".See McA's wisdom above.
- kcot showed wonderful and better alternative for doing what you wanted. However, if you still want to follow through on what you initially wrote then, DRY i.e Don't Repeat yourself!!!. i.e Instead of writing this
as many times as possible, put it in a sub, then call the sub, each time you need it.
print "Please press enter to quit \n";
my $fi = <STDIN>;
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me