gammaX500 has asked for the wisdom of the Perl Monks concerning the following question:

Ah - sorry, it is maybe a bug in Komodo, where the filename is truncated - if I run the script command line, no problem, thanks anyway - >>ignore the following..... I have a file processing program, that prompts the user to in put a file name then does some data cleaning etc. The problem is, for certain files I have to rename the file first, as it seems that the existing file name breaks the script - So I have pasted below a small input script, that accepts the input and then just does a print - and even that exhibits the problem. Tried to find a possible explanation on the net, but so far no good - Please help !
# This is an example of the filenames > # 518C7174-E4E9-4846-805D-2A16DF15D73A.distr my $cleanme; ## Initialize filename variable print("Enter filename: "); chomp($cleanMe =<STDIN>); print "*$cleanMe";

Replies are listed 'Best First'.
Re: Help with STDIN problem, losing data input
by Zaxo (Archbishop) on Nov 30, 2004 at 04:21 UTC

    What you have works for me. I notice you spell '$cleanme" two different ways. Could that be the problem in the real script? Using strict and warnings may help spot if that's the problem.

    After Compline,
    Zaxo

Re: Help with STDIN problem, losing data input
by diotalevi (Canon) on Nov 30, 2004 at 04:26 UTC
    There is nothing special about the snippet you have quoted to indicate anything that would have any complaint about the input you give it. All you're doing is reading a line from STDIN and then printing it after an asterisk. You'll have to show us a better snippet with what you gave it and what you got back that was unexpected.