Ask a Question related to PERL Miscellaneous, Design and Development.
-
Thomas Theakanath #1
equivalent of php function decbin
Perl-php gurus,
I need to port a php program to Perl and wonder the equivalent of
decbin function in PHP could be the following:
sub decbin {
my $num=shift;
my $str = unpack("b*",pack("N",$num));
return $str;
}
Regards
Thomas.
Thomas Theakanath Guest
-
"between" function equivalent in Perl?
Hello All- I'm attempting to extract a substring of characters from an alphanumeric text string. I've read a lot of Perl documentation on the... -
PHP equivalent to MOD
Hi, I need to see if a number is divisible by 2. I don't see the math function "mod" in my PHP Functions reference manual. Is there another way... -
php equivalent of CGI.pm
I'm translating several old cgi scripts (that use CGI.pm) to php. CGI.pm has a series of conventient function calls for generating HTML code on the... -
ACT! Equivalent for Mac?
Does anyone know if there is a Macintosh program whose features are roughly equivalent? This PC software runs on VPC, but is fairly sluggish.... -
What is equivalent to instrRev() function of VB-6 in Sql 2K ?
What is equivalent to instrRev() function of VB-6 in Sql 2K ? For example: Retrieving last dot position from 2.2.5.4.3 which is : 8 Best... -
Iain Truskett #2
Re: equivalent of php function decbin
* Thomas Theakanath <thomastk@hotmail.com>:
perlfaq4 - "How do I convert between numeric representations/bases/radixes?"> I need to port a php program to Perl and wonder the
> equivalent of decbin function in PHP could be the
> following:
[url]http://faq.perl.org/perlfaq4.html#How_do_I_convert_bet[/url]
The FAQ is worth a good read through so you have an idea of
what is in it.
cheers,
--
Iain.
Iain Truskett Guest
-
Thomas Theakanath #3
Re: equivalent of php function decbin
Thanks much. As usual, there are multiple ways to do this, per the
FAQ, using sprintf and Vector. My corrected routine would be the
following:
sub decbin {
my $num=shift;
my $str = unpack("B*",pack("N",$num));
return $str;
}
Thomas.
Thomas Theakanath Guest



Reply With Quote

