LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-13-2009, 08:43 AM   #1
shriyer
LQ Newbie
 
Registered: Jul 2009
Posts: 17

Rep: Reputation: 0
Perl if statement issue


if ( ( ( $val eq "ssd_max_throttle" ) || ( $val eq "ssd_io_time" ) ) && ( $proc eq "i386" ) ) {
print "im in";
next CONFLINE;
}

The code never goes in to the braces, even though $proc is i386,
and when the larger code parses thru values of Solaris kernel variables, and $var becomes ssd_max_throttle and then ssd_io_time.

If I eliminate the && ( test for $proc ) it goes into the braces.
I have printed out proc just outside this statement, and it is getting set as i386.

What am I doing wrong with this if statement ?
 
Old 08-13-2009, 08:53 AM   #2
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
I don't see any reason why that shouldn't work. First off, check your assumptions about your variables - have you had it print all three every time right before it hits that if?
 
Old 08-13-2009, 09:16 AM   #3
shriyer
LQ Newbie
 
Registered: Jul 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I wasnt chomping the proc variable.
Thanks
 
Old 08-13-2009, 09:58 AM   #4
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
I believe there's a 'mark thread closed' under thread tools. You might want to hit that for the benefit of other people here.
 
Old 08-13-2009, 07:07 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Mark as 'SOLVED' is better
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Does CGI/PERL have a Select Case Statement? craig467 Programming 2 02-16-2007 04:33 PM
Perl : if statement and RE's PB0711 Programming 4 02-04-2006 07:01 PM
perl - IO::Socket::INET - for (;;) statement?? AM1SHFURN1TURE Programming 3 03-29-2005 10:55 PM
need perl fuction like c #include statement for header file mrtwice Programming 5 06-19-2003 02:42 PM
Help in PERL with an IF statement! richhoward Programming 5 06-13-2003 12:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration