How do I fetch a news article or the active newsgroups? ... ::NNTPClient->new->list("newsgroups")'
uc $new | (uc $1 ^ $1) . ... # finish up with any remaining new (for when new is longer than old) if ($newlen > $oldlen) {
) 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.
; open(NEW, "> $new") or die "can't open $new: $!" ... ; close(NEW) or die "can't close $new: $!"
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
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
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.
Think of it this way: double-quote expansion is used to produce new strings. ... Those should (in 99.8% of the cases) be the simpler and more direct: print $var; $new = $old
also Usenet gateway to the mailing list used by the crack Perl development team (perl5-porters) at news ... ://news.perl.com/perl.porters-gw/ .
See perlhist (new as of 5.005) for Perl's milestone releases. ... You may snoop on pending developments via news://news.perl.com/perl.porters-gw/ and the Deja archive
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: $!
because that might cause a doubling of the hash table, in which half the entries get copied up to the new ... Even if the table doesn't double, there's no telling whether your new entry will be inserted before or
} } 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).
As of the 5.005 release, there's a much better approach, one which makes use of the new qr// operator ... : # use spiffy new qr// operator, with /i flag even use 5.005; @popstates = qw(CO ON MI
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
$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
interface to allow most XS modules to work unchanged, albeit perhaps without the efficiency that the new ... New features in Topaz are as yet undetermined, and will be addressed once compatibility and performance
The B::Xref module, shipped with the new, alpha-release Perl compiler (not the general distribution prior
; For more information, see also the new perlopentut if you have it (new for 5.6).
Because the pipe open takes place in two steps: first Perl calls fork() to start a new process, then ... this new process calls exec() to run the program you really wanted to open.
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
; To open file for writing, create new file if needed or else truncate old file: open(FH, "> $path ... See also the new perlopentut if you have it (new for 5.6).
Here's an example: $person = {}; # new anonymous hash $person->{AGE} = 24
You have to put a pod directive where the parser is expecting a new statement, not just in the middle
To change the file, make a new shadow password file (the format varies from system to system - see passwd
Here's an example: use HTTPD::UserAdmin (); HTTPD::UserAdmin ->new(DB => "/foo/.htpasswd
:-) If you want to override a predefined function, such as open(), then you'll have to import the new
You are probably using "main::foo" in new Perl code anyway, so this shouldn't be an issue.
without dynamic loading, then you just need to replace step 3 (make) with make perl and you will get a new
pg=q&what=news&fmt=.
When you call your function as &foo(), then you do get a new @_, but prototyping is still circumvented
use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new(); my
(bless-able) $fh = *SOME_FH{IO}; # blessed IO::Handle from *SOME_FH typeglob Or to use the new ... $fh = IO::Handle->new(); Then use any of those as you would a normal filehandle.
It's full of gotchas for old and new Perl programmers, and even has sections for those of you who are
The new, native-code compiler for Perl may eventually reduce the limitations given in the previous statement
defined $html or die "Can't fetch HTML from http://www.perl.com/"; $ascii = HTML::FormatText->new
MakeMaker for more information (in brief, just use make perl instead of a plain make to rebuild perl with a new
Don't forget the new perl modules, either.
for special topics, such as http://history.perl.org/ http://bugs.perl.org/ http://www.news.perl.org
might be able use the CPAN module Mail::Mailer: use Mail::Mailer; $mailer = Mail::Mailer->new
See http://language.perl.com/news/y2k.html for a longer exposition.
could grow the list this way: my ($head, $tail); $tail = append($head, 1); # grow a new
For more information on file locking, see also "File Locking" in perlopentut if you have it (new for
wide web support; server and daemon utilities; archiving and compression; image manipulation; mail and news
Left and right padding with any character, creating a new string: $padded = $pad_char x ( $pad_len
In fact, many Unix vendors now ship Perl by default, and support is usually just a news-posting away,
$oterm, $echo, $noecho, $fd_stdin); $fd_stdin = fileno(STDIN); $term = POSIX::Termios->new
isn't light-weight: use FileHandle; foreach $filename (@names) { my $fh = FileHandle->new
$sock = IO::Socket::INET->new(PeerAddr => 'www.perl.com', PeerPort
echo, $noecho, $fd_stdin); $fd_stdin = fileno(STDIN); $term = POSIX::Termios->new
get_rec { my $fh = shift; return scalar <$fh>; } If you're planning on generating new