On Tue, May 31, 2011 at 3:24 PM, Michael Greb <mich...@thegrebs.com> wrote:
> On Tue, May 31, 2011 at 02:27:53PM +1000, Sayth Renshaw wrote:
>> This there formula $oct_perm_str = sprintf "%o", $perms;
>> However it is not working for me. I have used my $oct = sprintf "%0", 
>> $number;
>
> You want '%o', the lower case letter o for the sprintf format string,
> the sample code you showed used '%0' the number.
>
> --
> Michael
> mich...@thegrebs.com
> M: +1-562-MIKEGRB
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Thanks I got it working with, that updated to be

my $hex = sprintf("ox%o2x\n", $number);
chomp($hex);
my $oct = sprintf "%o", $number;

When i turn on the assertion
use assertions ' $hex == $oct == $number ';

I am getting an error that an operator is required. Does that mean i
cannot compare a hex an octal and a decimal via equality in an
assertion?

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to