$mech->submit_form( # invoke the submit_form() object method. $form_string => $d, # Anything to the left of a # => is treated as like it's 'single quoted' # That means variables are not interpolated. # This is a possible bug in your script, # but not the one you're asking about. # *** Next comes the bug you're asking about. fields => { # The curly bracket begins an # anonymous hash. $param_string # This is a single scalar value } # You've completed the creation of the anonymous hash, but # you created it with one key (the contents of $param_string) # and no associated value. So you get an error message. ); #### $mech->submit_form( $form_string, $d, fields => { split( /=>\s+|,\s+/, $param_string ) } );