in reply to Re: Regular expression problem
in thread Regular expression problem

Thanks for your answer..

But this time it wasn't about html tags,,
It was just my way of sending extra information
to a sub that prints html code.

/jocke

Replies are listed 'Best First'.
Re^3: Regular expression problem
by saskaqueer (Friar) on Jun 09, 2004 at 09:52 UTC

    Still, there has got to be a better way than what you are doing. Perhaps you should use the named-parameter-list style of passing parameters to subroutines. Perhaps something like this?

    print_html( onChange => qq{ document.approveform.command.value='approve'; document.approveform.submit(); }, onClick => qq{ if (this.disabled) { alert('some text!'); } } ); sub print_html { my %param = @_; print "onChange: $param{'onChange'}\n" if ( exists $param{'onChange'} ); print "onClick: $param{'onClick'}\n" if ( exists $param{'onClick'} ); }

      Bend like a soft reed in the wind:

      sub print_html { my %param = @_; exists $param{$_} and print "$_: $param{$_}\n" for qw(onChange onClick); }

      jeffa

      I guess i should note for the record that this was my 2112th node, a Rush reference.