sivaramanm has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a problem in <STDIN>. When I use it inside a foreach loop, it doesn't terminate in command prompt for the first iteration.
Thanks
foreach (grep(/^.*\.xml$/, readdir(DIR))) { open (FIN, "<$_") or die ("$_ is not opened\n"); undef $/; print "Pls enter Section level value for $_ : "; chop ($seclev = <STDIN>) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with <STDIN>
by borisz (Canon) on Jun 28, 2006 at 07:27 UTC | |
|
Re: Problem with <STDIN>
by shmem (Chancellor) on Jun 28, 2006 at 07:27 UTC | |
|
Re: Problem with <STDIN>
by strat (Canon) on Jun 28, 2006 at 09:18 UTC | |
by GrandFather (Saint) on Jun 28, 2006 at 09:45 UTC | |
by ikegami (Patriarch) on Jun 28, 2006 at 14:20 UTC | |
by GrandFather (Saint) on Jun 28, 2006 at 20:20 UTC |