Tuesday, July 26, 2005

for loop in dos batch programming

Problem: I was wondering how a for loop would work in ms-dos batch programming and identified the following

solution: for /L %i in (,,) do command

for /L %i in (0,1,100) do echo %i%

Monday, July 25, 2005

perl libwww < 5.66

I had a terrible experience lately. I wanted to download a large document from a website and I opted to employ the content_file method. On versions of libwww < 5.66 I found that 'content_file'
$response = $browser->get("$url",':content_file' => $outfile);
Doesn't work as expected. An alternative method was identified Sean M. Burke where in one should use

HTTP::Request::Common;
$response = $ua->request( GET($url), $filespec );

which provides identical functionality but is compatible with older versions.

The article mentioned above can be found at: http://www.perl.com/pub/a/2002/08/20/perlandlwp.html?page=5

Friday, July 01, 2005

Creating a symlink in perl

How do you create a symlink in perl?

Its the easiest thing in the world. There is a symlink function that one could employ
symlink("existing","link-here");