Web

Web Perl module contains a set of useful routines for many webworking purposes.
Download

Web Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Wolfgang Wiese
  • Publisher web site:
  • http://search.cpan.org/~xwolf/web-1.35/web.pm

Web Tags


Web Description

Web Perl module contains a set of useful routines for many webworking purposes. Web Perl module contains a set of useful routines for many webworking purposes.This module was primarily made for UNIX/Linux-Systems. Parts of it cannot be used on other systems. E.g. the procedures for file locking demand systems that can use symlinks. If you use the modul on systems where symlinks cannot be used, fatal errors may happen.ABSTRACTThis perl module serves users with several useful routines for many purposes, like generating webpages, processing CGI scripts, working with XML datafiles and net-connections. It also uses own variants of routines, that was invented first in the famous libraries CGI.pm and cgi-lib.pl.INSTALLATIONIf you don't have sufficient privileges to install web.pm in the Perl library directory, you can put web.pm into some convenient spot, such as your home directory, or in cgi-bin itself and prefix all Perl scripts that call it with something along the lines of the following preamble: use lib '/home/myname/perl/lib'; use web;NLockThis routine allows to set a filelock across NFS-boundaries. The common used perl-routine flock() fails at this point, so this routine is a useable alternative for bigger file-systems. It uses the modular functions link() and unlink() to mark a file locked. In addition to this, it also gives the locked file a counter: A file that is locked for more than $web::MAX_LOCKTIME seconds will be freed by the next process that calls NLock() on this file. A calling process gets either 0 or 1 as a return value, where 1 is returned if the file-locking was successful. 0 is returned only if the process waits for more than $web::MAX_WAITLOCK seconds or if symlink() fails.Example 1: $filename = "data.txt"; NLock($filename); open(f1,"$filename"); # do something close f1; NUnlock($filename);Example 2: #!/local/bin/perl5 use web; $stat= &NLock("jump.pl"); print "Lock: stat= $statn"; $stat= &NLock("jump.pl"); print "Lock this file again: stat= $statn"; sleep 8; $stat= &NLock("jump.pl"); print "Lock this file again: stat= $statn"; $stat= &NUnlock("jump.pl"); print "Unlock: stat= $statn"; exit; Requirements: · Perl


Web Related Software