Greetings Im am not a perl programmer yet I am trying to learn and am debugging someone elses perl run script for use on a centos production box I have and I came across this elif [ -z "${SMTP_CDB:-}" ] Can someone please shed some light on what this eval means in English please? im mainly concerned with the stuff between the two " yet I need all the help I can get what does that say? Im trying to figure out if there is a typo or something in the script. I am not a perl programmer yet im sure I will be before I get done with this exercise in the next coupla weeks Thanks and kind regards - rh
Steve Walsh - Nerdvana Hosting
2006-Aug-27 07:22 UTC
[CentOS] perl script part eval help please?
elif is a contraction of else if used to extend if statements if Foo do x elif Bar then y elif dah then z else .... etc I *think* the -z is to see if variable is set or not (ie - unset variables = 0) the SMTP_CDB looks like a qmail variable, but my guess is the line in question is checking to see if SMTP_CDB variable in a qmail config file has been assigned a value. HTH Steve Email Lists wrote:> Greetings > > Im am not a perl programmer yet I am trying to learn and am debugging > someone elses perl run script for use on a centos production box I have and > I came across this > > elif [ -z "${SMTP_CDB:-}" ] > > Can someone please shed some light on what this eval means in English > please? > > im mainly concerned with the stuff between the two " yet I need all the help > I can get > > what does that say? Im trying to figure out if there is a typo or something > in the script. > > I am not a perl programmer yet im sure I will be before I get done with this > exercise in the next coupla weeks > > Thanks and kind regards > > - rh > > > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos
Email Lists wrote:> Greetings > > Im am not a perl programmer yet I am trying to learn and am debugging > someone elses perl run script for use on a centos production box I have and > I came across this > > elif [ -z "${SMTP_CDB:-}" ]That's not perl, that is part of a shell script. ${SMTP_CDB:-} returns an empty string if the Variable $SMTP_CDB is not set. See "Parameter Expansion" in the manual page of bash. And "test -z $string" returns true, if $string is empty. Regards, Ralph -- Ralph Angenendt......ra at br-online.de | .."Text processing has made it possible Bayerischer Rundfunk...80300 M?nchen | ....to right-justify any idea, even one Programmbereich.Bayern 3, Jugend und | .which cannot be justified on any other Multimedia.........Tl:089.5900.16023 | ..........grounds." -- J. Finnegan, USC -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20060827/6a2f924e/attachment-0002.sig>