John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
but this doesn't:use Win32::OLE; ... my $Paragraphs= $Doc->Paragraphs(); foreach my $para (in $Paragraphs) { ...
complaining "Can't call method "Paragraphs" without a package or object reference".foreach my $para (in $Doc->Paragraphs()) {
If I write
thinking maybe it's binding in tighter than the arrow, I get "Undefined subroutine &main::in called", so now it no longer knows what to do with in. I guess it's a "static" method; I had supposed it to be imported.foreach my $para (in ($Doc->Paragraphs())) {
What's going on here? Is this a basic parsing/context issue, or is something wierd going on?
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syntax and Temporary Variables
by wog (Curate) on Jul 20, 2001 at 23:14 UTC | |
by John M. Dlugosz (Monsignor) on Jul 21, 2001 at 01:09 UTC | |
|
Re: Syntax and Temporary Variables
by rchiav (Deacon) on Jul 21, 2001 at 00:41 UTC | |
by John M. Dlugosz (Monsignor) on Jul 21, 2001 at 01:06 UTC |