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.
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/ .
} } 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: $!
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 News archive
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
$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
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
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
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.006).
; 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.006).
Here's an example: $person = {}; # new anonymous hash $person->{AGE} = 24
To change the file, make a new shadow password file (the format varies from system to system - see passwd
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
A new use warnings pragma is in the works to provide finer control over all this.
If you're just looking for software, first use Alta Vista, Deja News, and search CPAN.
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
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=.
use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new(); my
When you call your function as &foo(), then you do get a new @_, but prototyping is still circumvented
For more information on file locking, see also "File Locking" in perlopentut if you have it (new for
(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.
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
Archives of comp.lang.perl.misc Have you tried Deja News or Alta Vista?
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.
Or use the CPAN module Mail::Mailer: use Mail::Mailer; $mailer = Mail::Mailer->new(); $
could grow 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.
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