bjohnso5 has asked for the wisdom of the Perl Monks concerning the following question:

Hello!

I am using a GetOptions () statement to obtain a bunch or parameters.

I currently have 62 options and I am receiving the error on a unix box "Bizarre copy of ARRAY in aassign at /Getopt/Long.pm line 272."

If I change the options number to 61, I no longer get that error? Any suggestions on what is wrong and how to fix it, I am currently using perl 5.8.4.

Thanks,
Brigid

  • Comment on Bizarre copy of ARRAY in aassign Long.pm

Replies are listed 'Best First'.
Re: Bizarre copy of ARRAY in aassign Long.pm
by toolic (Bishop) on Aug 07, 2009 at 18:43 UTC
    It would help if you shared your relevant code with us.

    Until then, lmgtfy.

    Update: Also, your version of perl is a little old, so perhaps your version of Getopt::Long is also old. You could browse the 'Changes' file to see what has changed since your version. Also, look at the bug reports.

      Here is the code that is not working it is long.....:
      GetOptions ( "type=s" => \$type, "adminuser=s" => \$adminuser, "adminpassword=s" => \$adminpassword, "serverurl=s" => \$serverurl, "serverport=s" => \$serverport, "stripe=s" => \$stripe, "propdir=s" => \$propdir, "targetserver=s" => \$targetserver, "environment=s" => \$environment, "deploy_proj_val=s" => \$deploy_proj_val, "keystoreLoc=s" => \$keystoreLoc, "classpath=s" => \$cp, "bobj_admin_username=s" => \$bobj_admin_username, "bobj_admin_password=s" => \$bobj_admin_password, "bobj_server=s" => \$bobj_server, "bobj_port=s" => \$bobj_port, "authentication=s" => \$authentication, "bobj_jar_loc=s" => \$bobj_jar_loc, "DS_domain=s" => \$DS_domain, "DS_port=s" => \$DS_port, "DS_username=s" => \$DS_username, "DS_password=s" => \$DS_password, "DS_projectName=s" => \$DS_projectName, "DS_istool_location=s" => \$DS_istool_location, "ftp_staging_address=s" => \$ftp_staging_address, "ftp_local_staging_folder=s" => \$ftp_local_staging_folder, "ftp_remote_staging_folder=s" => \$ftp_remote_staging_folder, "log_file_loc=s" => \$log_file_loc, "deployable_tech=s" => \$deployable_tech, "ftp_username=s" => \$ftp_username, "ftp_password=s" => \$ftp_password, "db_servername=s" => \$db_servername, "db_username=s" => \$db_username, "db_password=s" => \$db_password, "db_port=s" => \$db_port, "db_sid=s" => \$db_sid, "GG_prm_loc=s" => \$GG_prm_loc, "GG_mgr_loc=s" => \$GG_mgr_loc, "GG_defgen_loc=s" => \$GG_defgen_loc, "GG_defgenPRM_loc=s" => \$GG_defgenPRM_loc, "GG_defgenRPT_loc=s" => \$GG_defgenRPT_loc, "GG_stop_start_db=s" => \$GG_stop_start_db, "ggdb_servername=s" => \$ggdb_servername, "ggdb_username=s" => \$ggdb_username, "ggdb_password=s" => \$ggdb_password, "ggdb_port=s" => \$ggdb_port, "ggdb_sid=s" => \$ggdb_sid, "dash_server=s" => \$dash_server, "dash_port=s" => \$dash_port, "dash_user=s" => \$dash_user, "dash_password=s" => \$dash_password, "dash_database=s" => \$dash_database, "batch_dir=s" => \$batch_dir, "batch_server=s" => \$batch_server, "dpower_device_url=s" => \$dpower_device_url, "dpower_policy=s" => \$dpower_policy, "dpower_chkpt_name=s" => \$dpower_chkpt_name, "dpower_device_domain=s" => \$dpower_device_domain, "dpower_username=s" => \$dpower_username, "dpower_password=s" => \$dpower_password, "dpower_jar_loc=s" => \$dpower_jar_loc, "robo_server=s" => \$robo_server, "robo_dir=s" => \$robo_dir );
        I do not get your error when I run with your code, even when I use strict and warnings. I am on perl 5.8.8 and Getopt::Long version 2.37.

        Maybe you should try to use an option hash, rather than 62 separate scalars.

        bjohnso5:

        Please use:

        • code tags to surround your code (so we can read the code), and
        • the preview button (actually look at the preview--does it look correct?)

        Otherwise, many will simply ignore your post(s).

        ...roboticus