Incommunique

Powered by a whole foods plant based diet, a well dressed penguin and an over-active imagination

Quoting Hell

Perl (my fav programming language) is often accused of being line noise and other atrocities so imagine my delight when a colleague forwarded me the following line of code from VBScript


retValue = objWShell.Run(“”“”& executable &”“” -l -s “ & my_period & “ “”” & the_file & “”“”, 1, true)


The equivalent perl (he was rewriting a perl script I wrote to run in windows because they don’t install perl there) was a very happy


my @cmd_out = bplist -l -s $date $file 2>&1;
my $err_status = $? / 256;


Admittedly there’s some oddness (2>&1 and $? not to mention the backticks) if you don’t come from a unix world but it’s a world ahead of the quoting hell in the VBScript.


Share