The original plan was to sort the values in an array. Due to the fact that the values were paired it made it a bit harder.
Converting the array to a hash was a side-effect of an easy solution. I had originally looked into sorting the values without needing a hash but a sort on a hash seemed the...
Sorry, that should be:
sub orderPartA(){
my %orderHash = @_;
my %temp=();
my @missing;
foreach (keys %orderHash){
m/Q(\d+).2/;
$temp{$1} = 1;
}
@missing=grep(! $temp{$_}, (1..21));
$orderHash{"Q$missing[0].2=null"} = "Q$missing[0].1=null" unless...
I just realised that the suggestions are not going to work.
At the moment the hash is a conversion from the array, therefore the hash looks like this:
key data
Q1.2=qaz->Q1.1=bla
Q2.2=mar->Q2.1=foo
Q3.2=ehh->Q3.1=meh
The key isn't "Qx.2" It is actually "Qx.2=zzz"
This means that I...
Something like this should do:
s|images/|http://www.mysite.com/images/|g;
Usually you would use '/' for pattern matching/substitution but you can use pretty much any symbol you want.
Alchemy is easy with Perl!
s/lead/gold/g;
Hope you all had a good easter.
I have an interesting problem. I have a list of 38 values that need to be sorted. At this point quite simple but it gets worse.
The list is made up of pairs of values in the form 'Qx.1=zzz' and 'Qx.2=zzz' (where 'x' is a number from 1 to 20 and 'zzz' is a short...
I tinkered with inner join but couldn't quite get it to work properly. Your solution works perfectly, thanks.
Alchemy is easy with Perl!
s/lead/gold/g;
I have 3 tables that look sort of like this (only the relevant bits):
table 1: mainitems
itemid name
table 2: itemparts
id testID iname type count
table 3: category
id cat
items.testID is a reference to tests.itemID
items.type is a reference to category.id
An item ('a test') in...
Standard PCI graphics cards (not PCIx) will generally not function with onboard video, therefore the BIOS will automatically disable it. However, I have seen it done once before with hacked drivers. It depends on the motherboard and the video card.
So the short answer is, no.
Alchemy is easy...
At the moment, the date format is DD/MM/YYYY.
I was intitially thinking of avoiding the date format all together and just storing epoch time.
When a user makes a second entry (the other date to compare), the current epoch time is noted and the difference between the two values then converted...
Hello all.
Putting it simply, I need to find the number of days between two dates and do something if the days are < 30 and something else if days >= 30.
The 'something' my script has to do is not important at the moment.
I have been playing around with a few ideas but have been somewhat...
I have recently changed over to a new server with 2.0.54. It seems to be the default behaviour of Apache on the new server to try to excecute all files in a cgi-bin directory. In other words, Apache attempts to excecute all files, not just scripts.
My old server has 2.0.43 and didn't have this...
I Configured my Default DMZ Server to 192.168.0.2, also."
I wouldn't do that if I were you.
Your port forwarding would be useless if you have a DMZ configured for the same IP address.
A port forward to port 8888 on your machine would be fine.
Are you just using http://29.98.163.181 to access...
You may want to read this:
http://www.tek-tips.com/viewthread.cfm?qid=934985
Or this to save you time:
http://perl.plover.com/varvarname.html
Alchemy is easy with Perl!
s/lead/gold/g;
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.