Get flash to fully experience Pearltrees
perlsec - Perl security Perl is designed to make it easy to program securely even when running with extra privileges, like setuid or setgid programs. Unlike most command line shells, which are based on multiple substitution passes on each line of the script, Perl uses a more conventional evaluation scheme with fewer hidden snags.
Opens the file whose filename is given by EXPR, and associates it with FILEHANDLE. If FILEHANDLE is an expression, its value is used as the name of the real filehandle wanted. If EXPR is omitted, the scalar variable of the same name as the FILEHANDLE contains the filename. (Note that lexical variables--those declared with my --will not work for this purpose; so if you're using my , specify EXPR in your call to open.) If the filename begins with '<' or nothing, the file is opened for input. If the filename begins with '>', the file is truncated and opened for output.
Last updated 22 March 2001 [Links updated 7 September 2003] Jump to Contents or Index This is an HTMLified version of the Perl 5 Desktop Reference , ISBN 1-56592-187-9, copyright © 1996 by Johan Vromans . HTML copyright © 1996-2000 by Rex Swain .
Just enough perl to do most everything! Tom Christianson (spelling?) once posted a canonical list of one line perl programs to do many common command-line tasks. It included: # run contents of "my_file" as a program perl my_file
How many man-hours would you estimate you have invested in learning Perl? We all have only so many hours of life available to us. We must use some of those to learn the skills that allow us to make a living so we can use the remaining hours to do other things. Those learing hours are an investment in the quality of the other hours.
Everyone wants their Perl code to run faster. Unfortunately, without understanding why the code is taking so long to start with, it's impossible to know where to start optimizing it. This is where "profiling" comes in; it lets us know what our programs are doing. We'll look at why and how to profile programs, and then what to do with the profiling information once we've got it. There's nothing worse than setting off a long-running Perl program and then not knowing what it's doing.
Discussion Operating systems vary greatly in the type and reliability of locking techniques available. Perl tries hard to give you something that works, even if your operating system uses its own underlying technique. The flock function takes two arguments: a filehandle and a number representing what to do with the lock on that filehandle. The numbers are normally represented by names like LOCK_EX, which you can get from the Fcntl or IO::File modules.