Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Clear precompiled includes

Posted on 2002-03-26
7
Medium Priority
?
300 Views
Last Modified: 2013-11-18
A cgi page of mine gas a 'require global.pl' clause to include the global.pl file... I found out that this file (global.pl) is compiled to p-code the first time it is used and then only this cached p-code is used. So now when I change somehting in this file, I cannot get the changes reflected and working... It still uses the old precompiled file...

How do I get to clean this p-code cache and get my changes working???

I am using Perl 5.005
0
Comment
Question by:polygon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 16

Expert Comment

by:maneshr
ID: 6897877
ploygon,

"..s compiled to p-code the first time i..."

What is p-code? Since Perl is an interpreter language, how are you compiling your code?
Are you using a 3rd party Perl compier?

"..So now when I change somehting in this file, I cannot get the changes reflected and working... ..."

How can you say that for sure? Are you testing from a web browser based interface?
Can you please post that URL here?

This will help you get a more accurate answer, faster.
0
 
LVL 19

Expert Comment

by:Kim Ryan
ID: 6897909
Are you using some type of web server extension such as FastCGI or mod_perl (for Apache). If so, the web server should have a command to reset it's cahce of precompiled scripts.
0
 
LVL 6

Expert Comment

by:christopher sagayam
ID: 6898342
This might help..

Upload the main script as a different name plus change the name of the global.pl

once you get it working delete the old ones
0
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

 
LVL 5

Accepted Solution

by:
Sapa earned 1200 total points
ID: 6898947
polygon,

you should use

do "global.pl";

instead of

require "global.pl";

if you want to read and execute this file many times.
Keyword 'requere' is specially for modules, which
should be read once even if several other modules
require it. The alternative (but not ideologically
correct) way is delete corresponding record from
%main::INC, for example:

delete %main::INC{'global.pl'};
require 'global.pl';

Andrey

P.S. to maneshr:

> What is p-code? Since Perl is an interpreter language, how are you compiling your code?

P-Code is an alternative name for Byte-Code. Perl5 interpreter is not 'clear interpreter'. It execute perl
code in two steps, parsing and precompilation into internal byte-code representation, and bytecode execution.
It allows to execute repetitive code (loops, or subroutines) much faster, because thir bodies compiled only once. It also makes easy to implement 'call forward'
like:

hello('world');

sub hello {
  print 'Hello, ', @_;
}

although it's a bad style. Classical, one pass interpreter just know nothing about 'hello' function during call, because it does not read it's body yet.

Read 'perldoc perlcompile' for more detail info.

0
 
LVL 2

Author Comment

by:polygon
ID: 6899551
Sapa, you have been just great in answering my questions...

Thanks
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6899885
Sapa,

Thanks for taking the time to explain about p-code.
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6900496
0

Featured Post

Tutorial: Introduction to Managing a Linux Server

In this tutorial on systemd, we will explore:
-OS/Distro Adoption
-chkconfig and Other Legacy Commands
-Summary and Key Commands

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question