in reply to Re: Can I from within a module access variables from the calling program?
in thread Can I from within a module access variables from the calling program?

Hi,

Well thanks for your answer, I didn't understood it at first but now it get it ^^

I just have two "problems" with your answer, first I'm using Perl 5.8.8 and I'm not sure that your technique is compatible with this version since you're using Perl 5.10

Secondly, I would have prefered not to use another Module to do so

but thansk anyway, maybe your answer will help somebody else later

  • Comment on Re^2: Can I from within a module access variables from the calling program?

Replies are listed 'Best First'.
Re^3: Can I from within a module access variables from the calling program?
by tobyink (Canon) on Oct 25, 2012 at 13:29 UTC

    The only 5.10-specific feature I used was say which is a new (well... five years old) keyword which works like print but automatically appends a new line.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      Oh indeed that's quite usefull. Thanks I think i'll be able to adapt this