From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 01 February 2007 15:54
To: [email protected]
Subject: use constant still misbehaving?
> Seems there's more going wrong here. Sample code:
>
> use constant ( # note parens, not curlies
> CONT => 0,
> EXIT => 1,
> );
>
> sub use_it {
> my ($code, $msg) = @_;
>
> print "code = $code, message = \"$msg\"\n";
>
> }
> # now try the sub call:
> use_it( CONT, "hello world" );
>
>
------------------------------------------------------------------------
--------
>
> output:
>
> code = 0, message = "EXIT"
>
> If I replace the parens in the use constant line with curlies, it
works when interpreted and dies when compiled > as in my OP. The output
here is also from a compiled executable. I've given up on using the
constants, but
> would appreciate any insights as to just what the heck went wrong...
No. You must use curly brackets to define multiple constants.
I think your problem is probably a 'feature' of PerlApp. I tried your
example with pp and it seemed OK.
Also, consider defining constants one at a time. PerlApp may be happier
with that.
HTH
--
Brian Raven
_________________________________________
The information contained in this e-mail is confidential and solely
for the intended addressee(s). Unauthorised reproduction, disclosure,
modification, and/or distribution of this email may be unlawful. If you
have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message
do not necessarily reflect those of Atos Euronext Market Solutions.
_________________________________________
=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs