Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)

by sundialsvc4 (Abbot)
on Jun 17, 2015 at 13:54 UTC ( [id://1130809]=note: print w/replies, xml ) Need Help??


in reply to Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^2: Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)
by kcott (Archbishop) on Jun 17, 2015 at 19:38 UTC
    "The source-code to any installed package can also be found in the library directories of your computer. The PERL5LIB environment-variable (or its equivalent, found in some control-panel, in Windows), will tell you where."

    No, that's wrong!

    @INC contains the directories. These directories include whatever's in $PERL5LIB if it's been set or in $PERLLIB if that's been set.

    This is documented in perlrun: ENVIRONMENT:

    PERL5LIB
    A list of directories in which to look for Perl library files before looking in the standard library and the current directory.
    ...
    If PERL5LIB is not defined, PERLLIB is used. ...
    PERLLIB
    A list of directories in which to look for Perl library files before looking in the standard library and the current directory. If PERL5LIB is defined, PERLLIB is not used. ...

    You can confirm this with perl -V (look under %ENV: and @INC: at the end of the output).

    Please check your information before posting.

    -- Ken

Re^2: Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)
by marinersk (Priest) on Jun 18, 2015 at 05:12 UTC

    The source-code to any installed package can also be found in the library directories of your computer. The PERL5LIB environment-variable (or its equivalent, found in some control-panel, in Windows), will tell you where.

    Uhm...no. I can assure you CPAN modules are not installed in the directory where my personal Perl modules are stored; but rather, in the libdirectory under my various Perl installations. While this might be hinted at by the PATHenvironment variable (as seen in the example below), this is not assured. You can install Perl in a directory called M:\Booger.x, if you were so inclined.

    Also, under Windows, you needn't go to the System Control Panel Environment options screen to examine environment variables; they are still available in the command shell in much the same way they've always been, using the SETcommand:

          D:\PerlMonks>set | grep -i "perl"
    Path=C:\Steve\Utils;C:\cygwin\bin;C:\App\Java\jdk1.7.0_55\bin;C:\Perl\Perl-5.18.2.1802\site\bin;C:\Perl\Perl-5.18.2.1802\bin;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management EngineComponents\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\
    PERL5LIB=C:/Steve/Perl
    D:\PerlMonks>
         

    Update: This in contrast to the @INCvalues mentioned by kcott above:

         
    D:\PerlMonks>perl -e "print qq(@INC)" C:/Steve/Perl C:/Perl/Perl-5.18.2.1802/site/lib C:/Perl/Perl-5.18.2.18 +02/lib . D:\PerlMonks>
         

Re^2: Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)
by Anonymous Monk on Jun 17, 2015 at 14:26 UTC
    it’s also important to “do not do a thing already done.”

    Who are you quoting there?

    I'd like to look up why they think it is important to not do a thing already done.

      See also "re-inventing the wheel." This applies less to a learning exercise than production code produced under time pressure.

      Dum Spiro Spero

        See also "re-inventing the wheel." This applies less to a learning exercise than production code produced under time pressure.

        So GotToBTru is sundialsvc4 ?

        How does that answer the question Who are you quoting there?

      Frankly, for a beginner (which is ostensibly one of our key target audiences), I would encourage doing a thing already done, so you can compare how you approached the problem to those who have come before you.

      Most people learn by doing; or, perhaps more accurate to say that they cement their learnings by doing.

      So I, for one, take the opposite stance: It is vitally important for most beginners to do many things already done. That's how they develop their art.

      Plus, on the everpresent practical note, sometimes you can't use CPAN modules. We've hashed that over and over here at the Monastary for years; but the truth is sometimes you don't have the option to drink deeply from the CPAN well.

      At which point you need to have your art reasonably well-developed, as you will be re-inventing that wheel, and it sure would be nice if you made a decent showing of yourself in the process.

Re^2: Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)
by lulz (Initiate) on Jun 17, 2015 at 19:07 UTC
    Thank you for your reply!

    I have been looking at Apache ParseLog from CPAN and then read the comments. Then i switched over to App::YG::Apache, whose parser is much much more elegant and readable, but limited to one case. I know from my limited experience that the Perl regex machine is extremely fast when it comes to finding matches, but can take quite a long time for failures, so I was thinking, for a more general case, if there was yet another way to parse these files that might be faster without using regular expressions that I could play around with.

Re^2: Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)
by karlgoethebier (Abbot) on Jun 17, 2015 at 20:12 UTC
    “What’s all the fuss about, really?”

    Indeed.

    «The Crux of the Biscuit is the Apostrophe»

      You're on dangerous ground here karlgoethebier , don't paradox you'll destroy the universe!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1130809]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found