Re: One liner If statements

2003-01-02 Thread Rob Dixon
do { print "hi"; $somevar++; } if condition; (You don't need to parenthesize the conditional expression in this format.) HTH, Rob "Jensen Kenneth B Sra Afpc/Dpdmpq" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > In reading messages on

Re: One liner If statements

2003-01-02 Thread Tanton Gibbs
also: print (hi), $somevar++ if( condition ); - Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 02, 2003 1:04 PM Subject: Re: One liner If statements > do { > print "hi"; >

RE: One liner If statements

2003-01-02 Thread Jensen Kenneth B SrA AFPC/DPDMPQ
Can else statements be added? print (hi), $somevar++ if( condition ) else print (bye); -Original Message- From: Tanton Gibbs [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 1:07 PM To: [EMAIL PROTECTED] Subject: Re: One liner If statements also: print (hi), $somevar++ if

Re: One liner If statements

2003-01-02 Thread Paul Johnson
On Thu, Jan 02, 2003 at 12:56:46PM -0600, Jensen Kenneth B SrA AFPC/DPDMPQ wrote: > In reading messages on this list I've picked up some snippets like > > 'do some code here' if (condition); > > Can the same be done if you have an if statement like this > > If (condition){ > print "hi"; > $s

RE: One liner If statements

2003-01-02 Thread Dan Muey
print "hi"; $somevar++; } else { print "Joemama"; } -Original Message- From: Jensen Kenneth B SrA AFPC/DPDMPQ [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 1:17 PM To: 'Tanton Gibbs'; [EMAIL PROTECTED] Subj

RE: One liner If statements

2003-01-02 Thread Jensen Kenneth B SrA AFPC/DPDMPQ
: Dan Muey [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 1:25 PM To: [EMAIL PROTECTED] Subject: RE: One liner If statements Is there a specific reason you need to do it that way? If you need to run a bunch of code why not use sub routines if($hi eq $low) { &hi_is

RE: One liner If statements

2003-01-02 Thread Dan Muey
cool , makes sense, just wondering -Original Message- From: Jensen Kenneth B SrA AFPC/DPDMPQ [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 1:29 PM To: Dan Muey; [EMAIL PROTECTED] Subject: RE: One liner If statements No specific reason why, was just exploring other ways to

Re: One liner If statements

2003-01-02 Thread Rob Dixon
", $somevar++ if condition; is the same as print ("hi", $somevar++) if condition; which would print the unmodified value of $somevar. Something like: hi5 :-) Rob > - Original Message - > From: "Rob Dixon" <[EMAIL PROTECTED]> > To: <[EMAIL P

RE: One liner If statements

2003-01-02 Thread david
Jensen Kenneth B Sra Afpc/Dpdmpq wrote: > Can else statements be added? > > print (hi), $somevar++ if( condition ) else print (bye); good idea but it doens't work that way. try: #!/usr/bin/perl -w use strict; my $var = 1; $var ? ( print("hello world\n"), $var++, print("

Re: One liner If statements

2003-01-02 Thread R. Joseph Newton
PQ [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 1:29 PM > To: Dan Muey; [EMAIL PROTECTED] > Subject: RE: One liner If statements > > No specific reason why, was just exploring other ways to do the same thing. Messing >around with the benchmark module and seeing whi