For starters thanks to those who responded.
After I posted my question I got more info on the problem at hand. In a nutshell we have multiple computers communicating across an interface. One computer stores integers as signed magnitude (first bit is sign bit remaining bits are powers of two)...
I have an integer that needs converting. Basically I need to find it's 2's compliment and then use the first bit as the sign bit. Anybody know a good way to do it?
Well, after stepping away fron the problem for a little while and then referring to the bible as written by Larry Wall I happened on a solution.
my @hashlist = @{$MsgContents{A}};
I've been struggling with the following code now and am about to scream. Can someone please tell me how to pull a list out of a hash that contains lists?
my %MsgContents = (
A => [1, 2, 3],
B => [4, 5, 6]
);
my $single = $MsgContents{B}[0];
print $single; # prints 4 as expected
#my...
I would really appreciate it if you could take a look at the following regexes and let me know if there are any problems, including security issues. Handling URLs has proved to be tricky and I'm concerned I'm too forgiving in what I accept.
They are from a bulletin board script where the user...
goBoating
Thank you very very much. That is a huge help. I have one question. You use the i qualifier on the substitution. Does it get used? By that I mean the match pattern ($&) is checked for inclusion in the hash $keep_this (shouldn't that be %keep_this?). The hash values are case...
I'm writing a perl cgi application similar to a bulletin board. It's desired the user be able to enter simple html commands for bold text, italics, font formatting, etc. Rather than blindly accepting all html it would be best to accept a subset of innocuous html tags. What is a good way to do...
If your list ever grows beyond three the following example could do the trick as long as your assigned variables contain an alphanumeric. Note $var5 is undefined while $var2 is null.
$var1 = "a";
$var2 = "";
$var3 = "b";
$var4 = "c";
@mylist =...
I'm writing a perl bulletin board CGI script that allows the user to upload image files and display them in their message. They have the option of previewing their post prior to submitting and making changes to the form fields if needed. When they preview the form appears with their original...
I'm trying to write a snippet of code that will take a user to another page on my site when they move their mouse over a certain spot. The code below works fine in IE (if you swap the layer tags for div tags), but doesn't work at all in Netscape. Any suggestions or alternatives?
<layer...
I have a message board that I'd like to add a new feature to. Specifically I would like the user to be able to hit a button and have all messages on the board appear as though they've been read, i.e. change the link color to visited. This needs to hold up the next time they view the page. Is...
I'm using CGI.pm on my ISP's server but do not have write privaleges and need to make a few small changes. If I create a copy with the needed changes and put it in a directory, say /mydir/mymodules/, and then add "use lib '/mydir/mymodules/';" in my script will the script use my...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.