#!/usr/bin/perl
# Receiving arguments from PowerBuilder GUI
# March 31, 2007
use strict;
use Tk;
use Win32;
use Win32::API;
my ($flag_dcn,$flag_coco,$action,$option,$trs_xlsfile,$dropdown_value,$dropdown_country);
my (@collapsed,@arguments,$collapsed, $i,@arguments);
@arguments = @ARGV;
Win32::MsgBox("@arguments",0,'test'); # at this point I have in @arguments the whole array separated by |.
# Proble start here
@arguments = split(/|/,@arguments);
$flag_dcn= $arguments[0];
$flag_coco= $arguments[1];
$action= $arguments[2];
$option= $arguments[3];
$dropdown_value= $arguments[4];
$dropdown_country = $arguments[5];
$trs_xlsfile= $arguments[6];
Win32::MsgBox("DCN:$flag_dcn,COCO:$flag_coco,ACTION:$action,OPTION:$option,Excel:$trs_xlsfile,SiteManagerVersion:$dropdown_value,$dropdown_country",0,'test');
# ##################################################################
# Routine Trim. Remove Blank Spaces Left-Right
# ##################################################################
sub trim {
my @out = @_;
for (@out) {
s/^\s+//; # trim left
s/\s+$//; # trim right
}
return @out == 1
? $out[0] # only one to return
: @out; # or many
}