in reply to Re: constant variable using scaler variable
in thread constant variable using scaler variable

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^3: constant variable using scaler variable
by lamp (Chaplain) on Oct 01, 2008 at 09:20 UTC
    #!/usr/bin/perl use warnings; use strict; use constant ERR => "Error in program"; use constant OK => "successfully run"; my $failure_status = func(0); print $failure_status."\n"; my $sucess_status = func(1); print $sucess_status."\n"; sub func { my $error=shift; if ($error){ return ERR; } else { return OK; } }
Re^3: constant variable using scaler variable
by andreas1234567 (Vicar) on Oct 01, 2008 at 09:18 UTC
    How about:
    $ perl -l use strict; use warnings; use constant ERR => "Error in program"; sub func { return ERR; } print func(); __END__ Error in program
    --
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
Re^3: constant variable using scaler variable
by moritz (Cardinal) on Oct 01, 2008 at 11:33 UTC
    It's the exact same problem as in your original post, and the exact same solution (as suggested by lamp) applies.