XP is just a number | |
PerlMonks |
Re: exit the loop correctedby lemming (Priest) |
on Jul 10, 2002 at 22:12 UTC ( [id://180889]=note: print w/replies, xml ) | Need Help?? |
while ( $theSubBuild ne 'sci.bld' || 'esel.bld') I assume you meant for the loop to stop if $theSubBuild is equal to either of your strings. What Perl is doing is seeing if either of the expressions on both sides of the || are true. 'esel.bld' will always be true.
What you probably want is: Update: Fixed a bit of spelling and added comments since I was editing anyways. I'm uneasy about the grep system call into a file and then reopening the file. I'd rather just read from a pipe if I was going to use the system grep through a bunch of files. I tend to just read the files and get my info that way and leave the OS out of it.
In Section
Seekers of Perl Wisdom
|
|