How do I fetch a news article or the active newsgroups? ... ::NNTPClient->new->list("newsgroups")'
# 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));
) 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.
} } 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).
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
also USENET gateway to the mailing list used by the crack Perl development team (perl5-porters) at news ... ://news.perl.com/perl.porters-gw/ .
$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
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
The B::Xref module, shipped with the new, alpha-release Perl compiler (not the general distribution prior
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
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
For example: use FreezeThaw qw(freeze thaw); $new = thaw freeze $old; Where $old can be (a
See perlhist (new as of 5.005) for Perl's milestone releases. ... You may snoop on pending developments via news://genetics.upenn.edu/perl.porters-gw/ and http://www.frii.com
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
If you're just looking for software, first use Alta Vista, Deja News, and search CPAN.
Here's an example: use HTTPD::UserAdmin (); HTTPD::UserAdmin ->new(DB => "/foo/.htpasswd
A new use warnings pragma is in the works to provide finer control over all this.
:-) If you want to override a predefined function, such as open(), then you'll have to import the new
You should be 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
say which mail host to use $ENV{SMTPHOSTS} = 'mail.frii.com'; # create headers $header = new ... frii.com'); # create body $body = 'This is a test, ignore'; # create mail object $mail = new
pg=q&what=news&fmt=.
Archives of comp.lang.perl.misc Have you tried Deja News or Alta Vista?
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
defined $html or die "Can't fetch HTML from http://www.perl.com/"; $ascii = HTML::FormatText->new
(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 reduce the limitations given in the previous statement to some
; To open file for writing, create new file if needed or else truncate old file: open(FH, "> $path ... ; To open file for writing, create new file, file must not exist: sysopen(FH, $path, O_WRONLY|O_EXCL
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.
See http://language.perl.com/news/y2k.html for a longer exposition.
Or use the CPAN module Mail::Mailer: use Mail::Mailer; $mailer = Mail::Mailer->new(); $
wide web support; server and daemon utilities; archiving and compression; image manipulation; mail and news
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
get_rec { my $fh = shift; return scalar <$fh>; } If you're planning on generating new
echo, $noecho, $fd_stdin); $fd_stdin = fileno(STDIN); $term = POSIX::Termios->new