in reply to Re: Building custom routines with Sub-Exporter using the "-m" flag in a perl one-liner
in thread Building custom routines with Sub-Exporter using the "-m" flag in a perl one-liner

Thanks for that. I tried it out and got the following output:

$ perl -IWorkspace/sub-exporter -mCommunicate=greet,"{ greeting => q{W +ell-done},-as => q{say_to} }" -e 'say_to(q{Nelo})' group "as => q{say_to} }" is not exported by the Communicate module at + -e line 0 BEGIN failed--compilation aborted. $

When you said:

... the commas in the string need to be substituted by \x... equivalents

I assume that has something to do with unicode ... but I don't know quite how I would use that in this situation I'm afraid =(


Smoothie, smoothie, hundre prosent naturlig!
  • Comment on Re^2: Building custom routines with Sub-Exporter using the "-m" flag in a perl one-liner
  • Download Code

Replies are listed 'Best First'.
Re^3: Building custom routines with Sub-Exporter using the "-m" flag in a perl one-liner
by jethro (Monsignor) on Aug 21, 2008 at 16:45 UTC

    "\x2c" in an interpolated ascii string is the same as ",". But my idea was a idea borne from fast talking, no thinking. Won't work, because it will not be interpolated once it reaches perl code.

    Actually I don't know a way to make it work, I tried a few things but no success. My guess is that while Sub::Exporter wants to get a hash reference, it only gets a string that would generate a hash reference if it were executed as perl. So instead of {-as =>something} it gets a string "{-as =>something}"

      Okay, thanks for your input =)


      Smoothie, smoothie, hundre prosent naturlig!