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
use MIME::Lite; ### Create a new multipart message: $msg = MIME::Lite->new( ... =>'multipart/mixed' ); ### Add parts (each "attach" has same arguments as "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.
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
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/ .
Use the new_tmpfile class method from the IO::File module to get a filehandle opened for reading and ... ) 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
The B::Xref module, shipped with the new, alpha-release Perl compiler (not the general distribution prior
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).
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.
; For more information, see also the new perlopentut if you have it (new for 5.6).
See perlhist (new as of 5.005) for Perl's milestone releases. ... You may snoop on pending developments via nntp://news.perl.com/perl.porters-gw/ and the Deja archive
To change the file, make a new shadow password file (the format varies from system to system--see passwd
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
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
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
use FileHandle; $fh = FileHandle->new(); use IO::Handle; # 5.004 or higher ... $fh = IO::Handle->new(); Then use any of those as you would a normal filehandle.
Support is usually just a news-posting away, if you can't find the answer in the comprehensive documentation ... In August 2000 in all Linux distributions a new security problem was found in the optional 'suidperl'
The new, native-code compiler for Perl may eventually reduce the limitations given in the previous statement
It's full of gotchas for old and new Perl programmers and even has sections for those of you who are
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
such as http://bugs.perl.org/ http://history.perl.org/ http://lists.perl.org/ http://news.perl.org
Don't forget the new perl modules, either.
might be able use the CPAN module Mail::Mailer: use Mail::Mailer; $mailer = Mail::Mailer->new
could add to the list this way: my ($head, $tail); $tail = append($head, 1); # grow a new
See http://language.perl.com/news/y2k.html for a longer exposition.
For more information on file locking, see also "File Locking" in perlopentut if you have it (new for
Left and right padding with any character, creating a new string: $padded = $pad_char x ( $pad_len
wide web support; server and daemon utilities; archiving and compression; image manipulation; mail and news
$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
in trying it out, firstly because strictly speaking it is not a vi clone, it is the real vi, or the new