in reply to Re: Passing variables in LWP module
in thread Reaped: Passing variables in LWP module

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^3: Passing variables in LWP module
by stevieb (Canon) on Jun 30, 2015 at 15:36 UTC

    We do understand your question, it's you who might not be listening. You were advised to look into string interpolation and you barked back that you understand it. Carefully review the difference between the following two lines of code that print. One will print the variable, and the other won't.

    my $id = 555; print "{'type':'mcc','expression':'716*','order':1,'match-type':'regex +-match','category'->$id}"; print '{"type":"mcc","expression":"716*","order":1,"match-type":"regex +-match","category"->'$id'}';

    First, you can not have single quotes inside of a single quoted string. Second, using single quotes around a string ensures NO interpolation will happen (ie., you'll get $id instead of 555).

    There is no sense in asking the same question twice, especially when you argue against the advice you're already given.

    -stevieb