I have the CPAN Modules Inline::Files and Inline::Awk, and am using Strawberry Perl 5.18.1001.
I copied the simplest of the sample programs from the Inline::Awk page and attempted to run it:
#!C:\strawberry\perl\bin\perl.exe
use strict;
use warnings;
use Inline:: Files;
use Inline::AWK;
awk();
__END__
__AWK__
BEGIN { print "Hello, world!" }
++++++++++++++++++++++++++++++++++++++++++++++++++
However I get the error message:
Undefined subroutine &main::awk called at test_awk.pl
+++++++++++++++++++++++++++++++++++++++++++++++++
I looked for "Undefined subroutine" threads in Perl Monks and tried some of the alternate syntax suggestions, however I get the same error after trying each of these:
a) Change "awk" function call line to -- Inline::AWK::awk();
b) Change "use" line to -- use Inline::AWK qw(awk);
++++++++++++++++++++++++++++++++++++++++++++++++++
The strawberry folder holding the Awk.pm file is:
C:\strawberry\perl\site\lib\Inline
Is it possible that Inline::Awk works with regular Perl, but Inline::Awk fails when using Strawberry Perl?
++++++++++++++++++++++++++++++++++++++++++++++++++
My version of Strawberry Perl (5.18.1001) has a2p.pod but lacks a2p.exe.
When I removed "use strict" and "use warnings", and used "use Inline AWK;", I get the error message:
" 'a2p' is not recognized as an internal or external command, operable program or batch file."
(Removal of "use strict" is necessary, otherwise when including "use Inline AWK;" AWK is called a "bareword" and the program fails.)
Is it the case that the only remedy is to find some later version of Strawberry Perl that re-introduces a2p.exe? I can find no CPAN module that might be used to re-introduce a2p.
The Inline AWK CPAN module assumes that a2p is available.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.