in reply to Re^2: Sub calling sadness
in thread Sub calling sadness
It is not possible to explain the semantics of your code without access to the definition of ThatPackage. If you could include that definition, we could probably better explain what happens and why.
For example, include your definition of ThatPackage::blah something like this (after verifying that it still demonstrates the problem):
cheersuse Test::More 'no_plan'; #require 'some_file_with_my_functions.pm'; package ThatPackage; sub blah { return $_[0] =~ /hi/ }; # Does NOT demonstrate the problem package main; my $foo = "hi"; my $bar = " hi"; ok( ThatPackage::blah $foo, 'blah' ); ok( ThatPackage::blah $bar, 'blah2' ); ok( ThatPackage::blah($foo), 'blah3' ); ok( ThatPackage::blah($bar), 'blah4' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Sub calling sadness
by nefigah (Monk) on Mar 08, 2008 at 08:09 UTC |