Wednesday, March 5, 2008

Perl $^I trickery

sample code below:

$^I = ".bak";
@ARGV = "sample";
while (<>)
{
s/pattern_to_be_changed/pattern_to_replace/;
print;
}

what this code would do is that it would create a file called sample.bak which is a backup copy of the file named sample in the current directory. Then, it will do a string replace to sample.

neat huh? (for those of you who didn't know this)

This is especially handy when manipulating some program configuration file.
That's my 2 cents of the day.

P.S.
kudos to OtakuPinoy for the help he has given me today. OtakuPinoy, if you are reading this, you know you da man.

Tuesday, March 4, 2008

Statement of Purpose

This blog will serve as a recording device of my daily/weekly find of interesting things I may encounter in life. However, what "things" do I deem interesting? I am a software engineer(i kno this sounds emo) and I am interested in video games(pc, consoles alike), Japanese anime, and most importantly, software development (cough cough..)

So there you have it. This blogs will be dedicated to cover topics which I mentioned above and beyond.

So what does code kumi mean? You may go look up kumi in google but the answer lies much much.. shallower.