SEARCH RESULTS

FAQ

"How often are new versions of Perl released?" in perlfaq1

How often are new versions of Perl released? ... Recently, the plan has been to release a new version of Perl roughly every April, but getting the release

"How do I substitute case-insensitively on the LHS while preserving case on the RHS?" in perlfaq6

uc $new | (uc $1 ^ $1) . ... # finish up with any remaining new (for when new is longer than old) if ($newlen > $oldlen) {

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

) or system("mv", $old, $new); It may be more portable 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 merge two hashes?" in perlfaq4

If you want to preserve the original hashes, copy one hash (%hash1) to a new hash (%new_hash), then add ... don't want to create a new hash, you can still use this looping technique; just change the %new_hash

"How can I split a [character]-delimited string except when inside [character]?" in perlfaq4

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

"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.

"How can I copy a file?" in perlfaq5

use File::Copy; copy( $original, $new_copy ) or die "Copy failed: $!" ... You also have to remember to copy the permissions, owner, and group to the new file.

"How do I read email?" in perlfaq9

Use the Email::Folder module, like so: use Email::Folder; my $folder = Email::Folder->new('/path ... Simple objects, but we want # Email::MIME objects as they're more robust my $mime = Email::MIME->new

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

You have to put these directives at the beginning of the line and somewhere where Perl expects a new ... You end the comment with =cut, ending the Pod section: =pod my $object = NotGonnaHappen->new

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

Think of it this way: double-quote expansion is used to produce new strings. ... If you get used to writing odd things like these: print "$var"; # BAD my $new = "$old"

"How do I parse a mail header?" in perlfaq9

use Email::MIME; my $message = Email::MIME->new($rfc2822); my $subject = $message->header('Subject ... Abstract and then using its cast method to get an Email::MIME object: my $abstract = Email::Abstract->new

"How do I convert between numeric representations/bases/radixes?" in perlfaq4

("H*", pack("N", 3735928559)); Using Bit::Vector: use Bit::Vector; my $vec = Bit::Vector->new_Dec ... Using Bit::Vector: my $vec = Bit::Vector->new_Bin(32, "11011110101011011011111011101111"); my

"How do I change, delete, or insert a line in a file, or append to the beginning of a file?" in perlfaq5

; open my $out, '>', "$file.new" or die "Can't write new file: $!" ... open my $out, '>', "$file.new" or die "Can't write new file: $!"

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

work 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

"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 my $handle = IO::Socket::INET->new('www.perl.com:80') or die "can't connect to

"How do I automate an HTML form submission?" in perlfaq9

using the www_form_urlencode method from HTTP::Tiny: use HTTP::Tiny; my $ua = HTTP::Tiny->new ... use HTTP::Tiny; my $ua = HTTP::Tiny->new; my $url = 'https://metacpan.org/search'; my $

"Do I need to recompile XS modules when there is a change in the C library?" in perlfaq7

(contributed by Alex Beamish) If the new version of the C library is ABI-compatible (that's Application

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

foobarbar foobarbarbar Finally foo The $f that has "bar" added to it three times should be a new ... $f my $f should create a new lexical variable each time through the loop.

"Which Perl blogs should I read?" in perlfaq2

Perl News covers some of the major events in the Perl world, Perl Weekly is a weekly e-mail (and RSS

"How can I use a reference as a hash key?" in perlfaq4

This will mean a new variable might accidentally be associated with the value for an old. ... handle renaming the keys if you use multiple threads (which causes all variables to be reallocated at new

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

Functions

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 ... directory) immediately after a chroot, otherwise the current working directory may be outside of the new

sysseek - position I/O pointer on handle used with sysread and syswrite

The values for WHENCE are 0 to set the new position to POSITION; 1 to set it to the current position ... " function: use Fcntl 'SEEK_CUR'; sub systell { sysseek($_[0], 0, SEEK_CUR) } Returns the new

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

write - print a picture record

the page is advanced by writing a form feed and 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

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

join - join a list into a string using a separator

separate strings of LIST into a single string with fields separated by the value of EXPR, and returns that new

select - reset default output or do I/O multiplexing

If FILEHANDLE is supplied, sets the new current default filehandle for output. ... ; # This goes to $new_handle: print "ok 1\n"; ...

opendir - open a directory

an undefined scalar variable (or array or hash element), the variable is assigned a reference to 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.

sort - sort a list of values

$1 : undef ); push @caps, fc($_); } my @new = @old[ sort { ... = sort function_with_signature @old; # guarantee stability use sort 'stable'; my @new =

state - declare and assign a persistent lexical variable

Redeclaring a variable in the same scope or statement will "shadow" the previous declaration, creating a new

my - declare and assign a local variable (lexical scoping)

Redeclaring a variable in the same scope or statement will "shadow" the previous declaration, creating a 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: $! ... Here's an example: use Scalar::Util "blessed"; eval { ... ; die Some::Module::Exception->new

crypt - one-way passwd-style encryption

This ensures crypt will hash the new string with the same salt as the digest. ... When choosing a new salt create a random two character string whose characters come from the set [./0

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

fork - create a new process just like this one

fork Does a fork(2) system call to create a new process running the same program at the same point

open - open a file, pipe, or descriptor

In the child process, the filehandle isn't opened--I/O happens from/to the new STDOUT/STDIN. ... New code should favor the three-argument form of open over this older form.

dbmopen - create binding on a tied dbm file

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

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

The values for WHENCE are 0 to set the new position in bytes to POSITION; 1 to set it to the current

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

Documentation

feature - Perl pragma to enable new features

NAME feature - Perl pragma to enable new features SYNOPSIS use feature qw(fc say); # Without the ... New syntactic constructs, or new semantic meanings to older constructs, can be enabled by use feature

perlnewmod - preparing a new module for distribution

NAME perlnewmod - preparing a new module for distribution DESCRIPTION This document gives you some ... Check it's new There are a lot of modules on CPAN, and it's easy to miss one that's similar to what

perlmodlib - constructing new Perl modules and finding existing ones

Try to design the new module to be easy to extend and reuse. ... ->new(); ?

perldelta - what is new for perl v5.37.8

NAME perldelta - what is new for perl v5.37.8 DESCRIPTION This document describes differences between

Test2 - Framework for writing test tools that all work together.

it, adding many new features and capabilities. ... WHAT IS NEW? Easier to test new testing tools.

Dumpvalue - provides screen dump of Perl data.

SYNOPSIS use Dumpvalue; my $dumper = Dumpvalue->new; $dumper->set(globPrint => 1); $dumper->dumpValue ... ); $dumper->dumpvars('main'); my $dump = $dumper->stringify($some_value); DESCRIPTION Creation A new

perlreapi - Perl regular expression plugin interface

NAME perlreapi - Perl regular expression plugin interface DESCRIPTION As of Perl 5.9.5 there is a new ... instead of compiling a new one.

Encode::Alias - alias definitions to encodings

Encode::Alias - alias definitions to encodings SYNOPSIS use Encode; use Encode::Alias; define_alias( "newName ... to make the new definition available

Search::Dict - look - search for key in dictionary file

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

Devel::PPPort - Perl/Pollution/Portability

) newLISTOP newLOGOP newLOOPEX newLOOPOP newNULLLIST newOP newPMOP newPROG (undocumented) newPVOP newRANGE ... newRV newRV_inc newRV_noinc newSLICEOP newSTATEOP newSUB newSV newSViv newSVnv newSVOP newSVpv newSVpvn

SelectSaver - save and restore selected file handle

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

Test2::API::Stack - Object to manage a stack of Test2::Hub instances.

:Stack->new() This will create a new empty stack instance. ... $hub = $stack->new_hub() $hub = $stack->new_hub(%params) $hub = $stack->new_hub(%params, class

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::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.

Tie::Hash - base class definitions for tied hashes

, 'NewHash'; tie %new_std_hash, 'NewStdHash'; tie %new_extra_hash, 'NewExtraHash', sub {warn ... Associates a new hash instance with the specified class.

threads - Perl interpreter-based threads

5.8, thread programming has been available using a model called interpreter threads which provides a new ... $old_size = threads->set_stack_size($new_size); Sets a new default per-thread stack size, and returns

Encode::PerlIO - Encode::PerlIO -- a detailed document on Encode and PerlIO

If Perl is configured to use the new 'perlio' IO system then Encode provides a "layer" (see PerlIO) which ... iliad.utf8'); my @epic = <$iliad>; print $utf8 @epic; close($utf8); close($illiad); In addition, the new

Test::Harness - Run Perl standard test scripts with statistics

If you're writing new code consider using TAP::Harness directly instead. ... See "new" in TAP::Formatter::Base.

TAP::Parser::Scheduler - Schedule tests during parallel testing

VERSION Version 3.44 SYNOPSIS use TAP::Parser::Scheduler; DESCRIPTION METHODS Class Methods new ... my $sched = TAP::Parser::Scheduler->new(tests => \@tests); my $sched = TAP::Parser::Scheduler->new(

perlunitut - Perl Unicode Tutorial

This means that programmers need new habits. ... Your new toolkit Add to your standard heading the following line: use Encode qw(encode decode); Or

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

Perldeltas

"New Diagnostics" in perl5340delta

New Diagnostics New Errors Bareword filehandle "%s" not allowed under 'no feature "bareword_filehandles ... "' This accompanies the new bareword_filehandles feature.

"New Errors" in perl5340delta

New Diagnostics New Errors Bareword filehandle "%s" not allowed under 'no feature "bareword_filehandles ... "' This accompanies the new bareword_filehandles feature.

"New Errors" in perl5371delta

New Diagnostics New Errors A new syntax error has been added for the error that a catch block does

"New Diagnostics" in perl5371delta

New Diagnostics New Errors A new syntax error has been added for the error that a catch block does

"New Errors" in perl5376delta

New Diagnostics New Errors None

"New Diagnostics" in perl5376delta

New Diagnostics New Errors None

"New Diagnostics" in perl5377delta

New Diagnostics New Errors Object with arguments in @INC does not support a hook method

"New Errors" in perl5377delta

New Diagnostics New Errors Object with arguments in @INC does not support a hook method

"New Errors" in perl5140delta

New Diagnostics New Errors Closure prototype called This error occurs when a subroutine reference ... entry containing an object with a destructor that creates a new entry containing an object etc.

"New Diagnostics" in perl5140delta

New Diagnostics New Errors Closure prototype called This error occurs when a subroutine reference ... entry containing an object with a destructor that creates a new entry containing an object etc.

"New APIs" in perl5140delta

Internal Changes New APIs CLONE_PARAMS structure added to ease correct thread creation Modules that ... create threads should now create CLONE_PARAMS structures by calling the new function Perl_clone_params_new

"New Documentation" in perl5101delta

perlmroapi This describes the new interface for pluggable Method Resolution Orders. ... perlthanks This describes the new perlthanks utility.

"New Errors" in perl5374delta

New Diagnostics New Errors Too many nested BEGIN blocks, maximum of %d allowed Execution of %s aborted

"New Diagnostics" in perl5374delta

New Diagnostics New Errors Too many nested BEGIN blocks, maximum of %d allowed Execution of %s aborted

"New Documentation" in perl5375delta

Documentation New Documentation "Writing safer macros" in perlhacktips A new section has been added

"New Warnings" in perl5371delta

New Warnings Unknown locale category %d This is a shortened form of an already existing diagnostic ... , for use when there is no new locale being switched to.

"New Diagnostics" in perl5120delta

New or Changed Diagnostics New Diagnostics SV allocation tracing has been added to the diagnostics ... See perldiag for details of these new messages.

"New Warnings" in perl5320delta

New Warnings Code point 0x%X is not Unicode, and not portable This is actually not a new message, ... This new warning parallels the similar already-existing one raised for \o{}.

"New tests" in perl56delta

New tests lib/attrs Compatibility tests for sub : attrs vs the older use attrs. ... lib/env Tests for new environment scalar capability (e.g., use Env qw($BAR);).

"New tests" in perl561delta

New tests lib/attrs Compatibility tests for sub : attrs vs the older use attrs. ... lib/env Tests for new environment scalar capability (e.g., use Env qw($BAR);).

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