473,408 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Multiple conditions on a while loop

Hi All,

Can anyone help me how to give multiple conditions in a while loop in perl.

For example i have a while loop for which the value of a variable is A or B it should not enter in to the while loop.

Basically i need the condition in the while loop should contains "||". Is it possible?

If not can anyone suggest me an alternative

Thanks & Regards
Kavitha Potnuru
Aug 9 '07 #1
3 18164
KevinADC
4,059 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. unless ($var eq  'A' || $var eq 'B') {
  2.    while(some condition) {
  3.       do something
  4.    }
  5. }
  6.  
Aug 9 '07 #2
u can give names to the loop and use them;;

eg:-

LOOP: foreach(@arr){
while($_=~/^#/) {
next LOOP;
}
}
Aug 10 '07 #3
miller
1,089 Expert 1GB
Kavitha,

Your original premise is not entirely clear. However, maybe this is what you're talking about:

Expand|Select|Wrap|Line Numbers
  1. while ($var ne 'A' && $var ne 'B') {
  2.     # do something
  3. }
  4.  
- Miller
Aug 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: M Wells | last post by:
Hi All, Just wondering if anyone can tell me if you can test for multiple conditions as part of an "IF" statement in T-SQL in SQL Server 2000? ie something like: IF @merr = 1 or @merr=2...
2
by: Ginu | last post by:
Hi, the task is to identify semantically identical elements where some additional attributes do not match. The XSL-transformation should find a node NAME which @id attribute matches to another...
1
by: Work.Smarter.1 | last post by:
How do i subtract the first value from the second value without multiple queries? (query example below) SELECT Sum(tbl_Area_PropLend.Amount) AS Default_FinCharge FROM tbl_Area_PropLend GROUP BY...
2
by: dasanchez | last post by:
Hello, everyone. Please bear in mind that I have a very basic knowledge of VBA, but I think I can understand logic. I'm looking for a way to build a module that can help me parse the data in one...
10
by: greedo | last post by:
Hi, first of all, please bear with me, I don't really know a great deal about php programming, as will be painfully obvious from the code snippet I'm gonna post. But I need this problem solved, and...
13
by: TheLostLeaf | last post by:
Hi, Does anyone know if these 2 code segments would operate the same way. for instance if the first condition fails does it bother to check the second? if (MyList.Count 0 && CheckDate) {
5
by: jorgedelgadolopez | last post by:
Hi all, I am using the xpathnavigator evaluate function on .net (xpath 1 right?). Now I need to expand the code to do multiple contains, compare dates (such as 'before', 'between' and 'after'),...
3
by: bnashenas1984 | last post by:
Hi everyone I'v been looking in google but haven't got any answer for my question yet. Actualy I have a search page which works with mysql. my question is: SELECT * FROM usertable WHERE age >...
4
by: Hiramicus | last post by:
Hi - I'm using Access 2003. I have an input form that I'm trying to link to multiple tables. I have a command button that updates all the tables with the ~40 textboxes which the user inputs the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.