[template] url = http://www.wired.com/news_drop/palmpilot/ AvantGo = No maxdepth = 2 bpp = 4 compression = zlib title = Wired News no_url_info = True beamable = False ... # about 15 other arguments possible here [end_template] #### # Thanks for the help here 'demerphq' and 'hiseldl' if (defined $beamable && ($beamable =~ /1|true|yes/i)) { $beamable = '--beamable'; $beamable_msg = "Yes, document is beamable"; } elsif (defined $beamable && ($beamable =~ /0|false|no/i)) { $beamable = '--not-beamable'; $beamable_msg = "No, document is copy-protected"; } else { $beamable_msg = "Unspecified, defaults to beamable"; } print LOG " Beamable: $beamable\n"; # Test for no_url_info = value in the template if (defined $no_url_info && ($no_url_info =~ /1|true|yes/i)) { $no_url_info = '--no-urlinfo'; $no_url_info_msg = "No, url information disabled"; } elsif (defined $no_url_info && ($no_url_info =~ /0|false|no/i)) { $no_url_info = (); $no_url_info_msg = "Yes, url information shown"; } else { $no_url_info_msg = "Unspecified, url information shown"; } print LOG " url Info: $no_url_info\n"; #### my $systemcmd = "/usr/bin/appname"; my @systemargs = ('-p', $workpath, '-P', $workpath, '-H', $url, ($maxdepth < 3 ? "--maxdepth=$maxdepth" : "--maxdepth=2"), $bpp ? "--bpp=$bpp" : (), # thanks to 'tye' ($compression ? "--${compression}-compression" : ''), '-N', $title, $beamable ? $beamable : (), $no_url_info ? $no_url_info : (), '-V1', '-f', "$workpath/$md5file"); print LOG "Command: $systemcmd @systemargs\n"; system($systemcmd, @systemargs); #### my @args = ({s_arg =>'beamable', # argument name t_arg =>'--beamable', # true argument t_msg =>'Document is beamable', # true message f_arg =>'--not-beamable', # false argument f_msg =>'Document is protected},# false message s_arg =>'urlinfo', t_arg =>'', t_msg =>'Yes, url information provided', f_arg =>'--no-urlinfo', f_msg =>'No, no url information provided'})