First than all I declare that I am beginner Perl programmer (most probably "enthusiast")... I am facing a problem based upon the following code:<br><br>@list = ();<br>$end = "end!";<br><br>while ( $directory ne $end ) {<br>
print "Directory: ";<br> $directory = <STDIN>;<br> push (@list, $directory);<br> print @list;<br> } <br><br>Here's my explanation:<br><br>This code should ask for any number of "Directories" defined by $directory = <STDIN>;<br>
and<br>the program should stop asking for directories when the user input is: end!<br><br>Unfortunately, this last sentence is not being performed. You can check that there's not "break" as soon as $end is entered by the user. Then, this "while" becomes infinite.<br>
<br>Why do it happens? <br><br>It seems like: $directory ne $end is being ignored.<br><br>Thanks in advance for your assistance!<br><br>