Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
XP is just a number
 
PerlMonks  

Constant with Ternary operation

by Balaji_Jananayagam (Initiate)
on May 11, 2012 at 09:47 UTC ( #969957=perlquestion: print w/ replies, xml ) Need Help??
Balaji_Jananayagam has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys, Below code did not working in perl 5.10.x. It looks like constant doesn't support ternary operators. Shed some light.
use strict; my $hw = `uname -i`; my $word64 = 1 if ( $hw =~/x86_64|ia32e/); print "word $word64\n"; use constant CRACKLIB => $word64 ? '/usr/lib64/cracklib_dict' : ' +/usr/lib/cracklib_dict' ;
Thanks in advance! Balaji

Comment on Constant with Ternary operation
Download Code
Re: Constant with Ternary operation
by marto (Chancellor) on May 11, 2012 at 10:17 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://969957]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2013-05-18 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (394 votes), past polls