SEARCH RESULTS

FAQ

"How do I fetch a news article or the active newsgroups?" in perlfaq9

How do I fetch a news article or the active newsgroups? ... ::NNTPClient->new->list("newsgroups")'

"How do I substitute case insensitively on the LHS, but preserving case on the RHS?" in perlfaq6

# finish up with any remaining new (for when new is longer than old) if ($newlen > $oldlen) { ... } elsif ($state == 2) { substr($new, $oldlen) = uc(substr($new, $oldlen));

"How can I reliably rename a file?" in perlfaq5

) or system("mv", $old, $new); It may be more compelling to use the File::Copy module instead. ... You just copy to the new file to the new name (checking return values), then delete the old one.

"How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?" in perlfaq5

; open(NEW, "> $new") or die "can't open $new: $!" ... ; close(NEW) or die "can't close $new: $!"

"How can I split a [character] delimited string except when inside [character]? (Comma-separated files)" in perlfaq4

He suggests (assuming your string is contained in $text): @new = (); push(@new, $+) while ... | , }gx; push(@new, undef) if substr($text,-1,1) eq ','; If you want to represent quotation

"How stable is Perl?" in perlfaq1

Production releases, which incorporate bug fixes and new functionality, are widely tested before release ... invalidate a program written for an earlier version of perl (barring accidental bug fixes and the rare new

"What's the difference between dynamic and lexical (static) scoping? Between local() and my()?" in perlfaq7

local($x) saves away the old value of the global variable $x, and assigns a new value for the duration ... my($x) creates a new variable that is only visible in the current subroutine.

"What is variable suicide and how can I prevent it?" in perlfaq7

} } T; print "Finally $f\n"; The $f that has "bar" added to it three times should be a new ... $f (my $f should create a new local variable each time through the loop).

"How do I make a temporary file name?" in perlfaq5

Use the new_tmpfile class method from the IO::File module to get a filehandle opened for reading and ... use IO::File; $fh = IO::File->new_tmpfile() or die "Unable to make new temporary file

"What are the Perl newsgroups on USENET? Where do I post questions?" in perlfaq2

also USENET gateway to the mailing list used by the crack Perl development team (perl5-porters) at news ... ://news.perl.com/perl.porters-gw/ .

"I put a regular expression into $/ but it didn't work. What's wrong?" in perlfaq6

$fh = new FileHandle "+<file"; ## Attach it to a "stream" object. ... use Net::Telnet; $file = new Net::Telnet (-fhopen => $fh); ## Search for the second line and

"Can I use perl to run a telnet or ftp session?" in perlfaq8

handshaking, then the standard dual-process approach will suffice: use IO::Socket; # new ... in 5.004 $handle = IO::Socket::INET->new('www.perl.com:80') || die "can't connect to

"How do I cross-reference my Perl programs?" in perlfaq3

The B::Xref module, shipped with the new, alpha-release Perl compiler (not the general distribution prior

"What's wrong with always quoting "$vars"?" in perlfaq4

If you get used to writing odd things like these: print "$var"; # BAD $new = "$old"; ... Those should (in 99.8% of the cases) be the simpler and more direct: print $var; $new = $old

"How do I shuffle an array randomly?" in perlfaq4

works using splice, randomly picking another element to swap the current element with: srand; @new ... = (); @old = 1 .. 10; # just a demo while (@old) { push(@new, splice(@old, rand @old

"How do I print out or copy a recursive data structure?" in perlfaq4

For example: use FreezeThaw qw(freeze thaw); $new = thaw freeze $old; Where $old can be (a

"How do I declare/create a structure?" in perlfaq7

Here's an example: $person = {}; # new anonymous hash $person->{AGE} = 24

"How do I modify the shadow password file on a Unix system?" in perlfaq8

To change the file, make a new shadow password file (the format varies from system to system - see passwd

"How can I comment out a large block of perl code?" in perlfaq7

You have to put a pod directive where the parser is expecting a new statement, not just in the middle

"Where should I post source code?" in perlfaq2

If you're just looking for software, first use Alta Vista, Deja News, and search CPAN.

More results found. Refine your search terms or show all FAQ results.

Functions

sysseek

The values for WHENCE are 0 to set the new position to POSITION, 1 to set the it to the current position ... Returns the new position, or the undefined value on failure.

link OLDFILE,NEWFILE Creates a new filename linked to the old filename.

push - append one or more elements to an array

Returns the new number of elements in the array.

tie - bind a variable to an object class

Any additional arguments are passed to the "new()" method of the class (meaning TIESCALAR, TIEARRAY, ... The object returned by the "new()" method is also returned by the tie() function, which would be useful

symlink OLDFILE,NEWFILE Creates a new filename symbolically linked to the old filename.

write - print a picture record

record, the page is advanced by writing a form feed, a special top-of-page format is used to format the new ... The number of lines remaining on the current page is in variable $-, which can be set to 0 to force a new

unshift - prepend more elements to the beginning of a list

Prepends list to the front of the array, and returns the new number of elements in the array.

chroot - make directory new root for path lookups

chroot This function works like the system call by the same name: it makes the named directory the new

reverse - flip a string or a list

Also, this has to unwind one hash and build a whole new one, which may take some time on a large hash

die - raise an exception or bail out

\n" unless chdir '/usr/spool/news'; chdir '/usr/spool/news' or die "Can't cd to spool: $!

dump - create an immediate core dump

When the new binary is executed it will begin by executing a goto LABEL (with all the restrictions that

sort - sort a list of values

first integer after the first = sign, or the # whole record case-insensitively otherwise @new ... $#old ]; # same thing using a Schwartzian Transform (no temps) @new = map { $

alarm - schedule a SIGALRM

previous timer, and an argument of 0 may be supplied to cancel the previous timer without starting a new

seek - reposition file pointer for random-access I/O

The values for WHENCE are 0 to set the new position to POSITION, 1 to set it to the current position

dbmopen - create binding on a tied dbm file

Example: # print out history file offsets dbmopen(%HIST,'/usr/lib/news/history',0666); while

open - open a file, pipe, or descriptor

open(LOG, '>>/usr/spool/news/twitlog'); # (log is reserved) # if the open fails, output is discarded ... In the child process the filehandle isn't opened--i/o happens from/to the new STDOUT or STDIN.

Documentation

perldelta - what's new for perl5.005

See "New INIT keyword", "New lock keyword", and "New qr// operator". ... See "New Diagnostics". Licensing Perl has a new Social Contract for contributors.

perlmodlib - constructing new Perl modules and finding existing ones

For example, does your application still work if you change: $obj = new YOURCLASS; into: $obj = new SUBCLASS ... Don't delete the original .pl file till the new .pm one works!

CGI::Switch - Try more than one constructors and return the first object available

available SYNOPSIS use CGISwitch; -or- use CGI::Switch This, That, CGI::XA, Foo, Bar, CGI; my $q = new ... CGI::Switch; DESCRIPTION Per default the new() method tries to call new() in the three packages Apache

Tie::Handle - base class definitions for tied handles

NAME Tie::Handle - base class definitions for tied handles SYNOPSIS package NewHandle; require Tie ... Associates a new glob instance with the specified class.

Search::Dict - search for key in dictionary file

Returns the new file position, or -1 if an error occurs.

SelectSaver - save and restore selected file handle

SelectSaver - save and restore selected file handle SYNOPSIS use SelectSaver; { my $saver = new ... SelectSaver; # new handle may be selected, or not } # previous handle is selected DESCRIPTION A

Tie::Scalar - base class definitions for tied scalars

, 'NewScalar'; tie $new_std_scalar, 'NewStdScalar'; DESCRIPTION This module provides some skeletal ... Associates a new scalar instance with the specified class.

Tie::Hash - base class definitions for tied hashes

, 'NewHash'; tie %new_std_hash, 'NewStdHash'; DESCRIPTION This module provides some skeletal methods ... Associates a new hash instance with the specified class.

perlxs - XS language reference manual

delete THIS; If the function's name is new then the C++ new function will be called to create a dynamic ... color * color::new() The C++ code will call new.

AnyDBM_File - provide framework for multiple DBMs

This way old programs that used to use NDBM via dbmopen() can still do so, but new ones can reorder @ ... trivial to copy database formats: use POSIX; use NDBM_File; use DB_File; tie %newhash, 'DB_File', $new_filename

B - The Perl Compiler

The B module is of use to those who want to write new compiler backends.

perlbot - Bag'o Object Tricks (the BOT)

A subclass may want to override that data and replace it with new data. ... bless $self, $type; } package main; $a = Bar->new; $b = Foo->new; $a->enter; $b->enter; INHERITING

IO::Select - OO interface to the select system call

CONSTRUCTOR new ( [ HANDLES ] ) The constructor creates a new object and optionally initialises ... socket $new = $lsn->accept; $sel->add($new); } else {

ExtUtils::Packlist - manage .packlist files

The new() method returns a reference to a hash. ... If no file is specified, the .packlist specified to new() will be read.

IO::Socket - Object interface to socket communications

(see the Symbol package). new optionally takes arguments, these arguments are in key-value pairs. new ... In a scalar context the new socket is returned, or undef upon failure.

perlguts - Perl's Internal Functions

The six routines are: SV* newSViv(IV); SV* newSVnv(double); SV* newSVpv(char*, int); SV* newSVpvn ... void* New( x, void *ptr, int size, type ) newAV Creates a new AV.

Class::Struct - declare struct-like datatypes as Perl classes

The new class is given a constructor method, new, for creating struct objects. ... A function named new must not be explicitly defined in a class created by struct.

perltoot - Tom's object-oriented tutorial for perl

Person::new() is the function that both the Person->new() method and the Employee->new() method end up ... () Person::new("Person") Employee->new() Person::new("Employee") So don't use function

IO::Pipe - supply object methods for pipes

NAME IO::pipe - supply object methods for pipes SYNOPSIS use IO::Pipe; $pipe = new IO::Pipe; if( ... If no arguments are given then method handles is called on the new IO::Pipe object.

perlobj - Perl objects

Here is a typical constructor: package Critter; sub new { bless {} } That word new isn't special. ... Saying new Critter ('Bam' x 2), 1.4, 45 would be equivalent to Critter->new('Bam' x 2), 1.4, 45 which

More results found. Refine your search terms or show all documentation results.

Perldeltas

"New and changed syntax" in perl5004delta

New and changed syntax $coderef->(PARAMS) A subroutine reference may now be suffixed with an arrow ... This new syntax follows the pattern of $hashref->{FOO} and $aryref->[$foo]: You may now write &$subref

"New Diagnostics" in perl5004delta

New Diagnostics Several new conditions will trigger warnings that were silent before. ... The following new warnings and errors outline these.

"New builtin methods" in perl5004delta

New builtin methods The UNIVERSAL package automatically contains the following methods that are inherited

"New and changed builtin constants" in perl5004delta

New and changed builtin constants __PACKAGE__ The current package name at compile time, or the undefined

"New and changed builtin variables" in perl5004delta

New and changed builtin variables $^E Extended error message on some platforms. ... Not actually new, but newly documented.

"New and changed builtin functions" in perl5004delta

It is the recommended method for new code. ... (Not actually new; just never documented before.)

"New Opcode module and revised Safe module" in perl5004delta

New Opcode module and revised Safe module A new Opcode module supports the creation, manipulation and ... The revised Safe module has a new API and is implemented using the new Opcode module.

"Documentation Changes" in perl5004delta

perldebug Although not new, this has been massively updated. ... perlsec Although not new, this has been massively updated.

"More precise warnings" in perl5004delta

Each new perl version tends to remove some undesirable warnings, while adding new warnings that may catch

"Support for More Operating Systems" in perl5004delta

Support for More Operating Systems Support for the following operating systems is new in Perl 5.004.

"Math::Trig" in perl5004delta

Math::Trig This new module provides a simpler interface to parts of Math::Complex for those who need

"C Language API Changes" in perl5004delta

perl_eval_pv A new function handy for eval'ing strings of Perl code inside C code. ... New extensions must use the new hash access functions and macros if they wish to use SV* keys.

"Utility Changes" in perl5004delta

Sends converted HTML to standard output The pod2html utility included with Perl 5.004 is entirely new

"pod2html" in perl5004delta

Sends converted HTML to standard output The pod2html utility included with Perl 5.004 is entirely new

"Internal change: FileHandle class based on IO::* classes" in perl5004delta

We suggest, but do not require, that you use the IO::* modules in new code.

"Compilation option: Binary compatibility with 5.003" in perl5004delta

Foo.pm in @INC" error now lists @INC Compilation option: Binary compatibility with 5.003 There is a new

""Can't locate Foo.pm in @INC" error now lists @INC" in perl5004delta

Foo.pm in @INC" error now lists @INC Compilation option: Binary compatibility with 5.003 There is a new

"Fcntl" in perl5004delta

Fcntl New constants in the existing Fcntl modules are now supported, provided that your operating system

"Changes to tainting checks" in perl5004delta

The new restrictions when tainting include: No glob() or <*> These operators may spawn the C shell

"Pragmata" in perl5004delta

Pragmata Six new pragmatic modules exist: use autouse MODULE => qw(sub1 sub2 sub3) Defers require

More results found. Refine your search terms or show all perldelta results.