[Athens-pm] Perl oddities

Philip Lees pjlees at ics.forth.gr
Fri Nov 15 07:27:37 CST 2002


Hi back to Michael and all of you. Just for fun, try and get your heads
around this:

my $fubar = "0";

if( print $fubar and $fubar ? $fubar : $fubar++ ){
	print " seriously FUBAR\n";
}else{
	print " becomes $fubar\n";
}

Note that the same variable functions as a string, a boolean and a
number - all within one line of code.

Ain't Perl wonderful?

Philip
--
Philip Lees
Working Group on Cardiology
ICS-FORTH, Science and Technology Park of Crete
Vassilika Vouton, P.O. Box 1385, GR 711 10 Heraklion, Crete, GREECE

tel.: +30-810-391680, fax: +30-810-391601, e-mail: pjlees at ics.forth.gr

'The aim of high technology should be to simplify, not complicate' -
Hans Christian von Baeyer 




More information about the Athens-pm mailing list