Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Output Repeats in the elsif statement

by Kenosis (Priest)
on Feb 13, 2013 at 21:08 UTC ( #1018637=note: print w/replies, xml ) Need Help??

in reply to Output Repeats in the elsif statement

Were you trying to test whether $carroadnameverify2 is null in the elsif statement? If so, I think you meant this:

... elsif ($carroadnameverify2 eq '') { ...

$carroadnameverify2 =~ '' will evaluate to true, regardless of $carroadnameverify2's value or whether it's even defined.

Replies are listed 'Best First'.
Re^2: Output Repeats in the elsif statement
by PilotinControl (Monk) on Feb 13, 2013 at 21:19 UTC

    changing it to "eq" causes the output to be blank not returning the Car Record Not Found...leaving it at =~ causes the Car Record Not Found to be repeated over and over for three lines of output...thats the problem

      Ah! Just use else:

      else { printf("CAR RECORD NOT FOUND"); }

      As your if tests for the record...

        changing the line to } else { did not work all it did was create this: which is the output I get and all i need it to say is Car Record Not Found once not multiple times

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018637]
[holli]: gtg, l8er you lovely bunch

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-11-21 14:04 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (302 votes). Check out past polls.