P
Parapura Rajkumar
hey all
I am attaching a small script to illustrate my problem. The
attached script executes correctly.
But if I make Call 2 same as Call1 ie
do
WriteLine "Test2" ; instead of WriteLine( "Test2" );
I get an error
String found where operator expected at /Users/foobar/bin/stest.pl
line 26, near "WriteLine "Test2""
(Do you need to predeclare WriteLine?)
syntax error at /Users/foobar/bin/stest.pl line 26, near "WriteLine
"Test2""
Execution of /Users/foobar/bin/stest.pl aborted due to compilation
errors.
Is this by design, is there an workaround ?
Thanks in advance
Raj
-----------------------------------------------------
use strict;
use warnings;
package LogHelper;
use base 'Exporter';
our @EXPORT = ('WriteLine');
sub WriteLine
{
print @_ , "\n";
}
package main;
import LogHelper;
sub WriteLine2
{
print @_ , "\n";
}
#Call 1
WriteLine2 "Test1";
#Call 2
WriteLine( "Test2" );
I am attaching a small script to illustrate my problem. The
attached script executes correctly.
But if I make Call 2 same as Call1 ie
do
WriteLine "Test2" ; instead of WriteLine( "Test2" );
I get an error
String found where operator expected at /Users/foobar/bin/stest.pl
line 26, near "WriteLine "Test2""
(Do you need to predeclare WriteLine?)
syntax error at /Users/foobar/bin/stest.pl line 26, near "WriteLine
"Test2""
Execution of /Users/foobar/bin/stest.pl aborted due to compilation
errors.
Is this by design, is there an workaround ?
Thanks in advance
Raj
-----------------------------------------------------
use strict;
use warnings;
package LogHelper;
use base 'Exporter';
our @EXPORT = ('WriteLine');
sub WriteLine
{
print @_ , "\n";
}
package main;
import LogHelper;
sub WriteLine2
{
print @_ , "\n";
}
#Call 1
WriteLine2 "Test1";
#Call 2
WriteLine( "Test2" );