=head1 NAME
-perlfaq3 - Programming Tools ($Revision: 1.40 $, $Date: 2004/10/19 17:02:27 $)
+perlfaq3 - Programming Tools ($Revision: 1.41 $, $Date: 2004/11/03 22:45:32 $)
=head1 DESCRIPTION
philosophy is the philosophy of several small tools that each do one
thing and do it well. It's like a carpenter's toolbox.
-If you want an IDE, check the following:
+If you want an IDE, check the following (in alphabetical order, not
+order of preference):
=over 4
+=item Eclipse
+
+The Eclipse Perl Integration Project integrates Perl
+editing/debugging with Eclipse.
+
+The website for the project is http://e-p-i-c.sf.net/
+
=item Komodo
-ActiveState's cross-platform (as of April 2001 Windows and Linux),
-multi-language IDE has Perl support, including a regular expression
+ActiveState's cross-platform (as of October 2004, that's Windows, Linux,
+and Solaris), multi-language IDE has Perl support, including a regular expression
debugger and remote debugging
-( http://www.ActiveState.com/Products/Komodo/ ). (Visual
-Perl, a Visual Studio.NET plug-in is currently (early 2001) in beta
-( http://www.ActiveState.com/Products/VisualPerl/index.html )).
+( http://www.ActiveState.com/Products/Komodo/ ).
=item Open Perl IDE
and debugging Perl scripts with ActiveState's ActivePerl distribution
under Windows 95/98/NT/2000.
+=item OptiPerl
+
+( http://www.optiperl.com/ ) is a Windows IDE with simulated CGI
+environment, including debugger and syntax highlighting editor.
+
=item PerlBuilder
( http://www.solutionsoft.com/perl.htm ) is an integrated development
( http://helpconsulting.net/visiperl/ )
From Help Consulting, for Windows.
-=item OptiPerl
+=item Visual Perl
+
+( http://www.activestate.com/Products/Visual_Perl/ )
+Visual Perl is a Visual Studio.NET plug-in from ActiveState.
-( http://www.optiperl.com/ ) is a Windows IDE with simulated CGI
-environment, including debugger and syntax highlighting editor.
=back
=head1 NAME
-perlfaq4 - Data Manipulation ($Revision: 1.55 $, $Date: 2004/10/11 05:06:29 $)
+perlfaq4 - Data Manipulation ($Revision: 1.56 $, $Date: 2004/11/03 22:47:56 $)
=head1 DESCRIPTION
=head2 What happens if I add or remove keys from a hash while iterating over it?
-Don't do that. :-)
+(contributed by brian d foy)
-[lwall] In Perl 4, you were not allowed to modify a hash at all while
-iterating over it. In Perl 5 you can delete from it, but you still
-can't add to it, because that might cause a doubling of the hash table,
-in which half the entries get copied up to the new top half of the
-table, at which point you've totally bamboozled the iterator code.
-Even if the table doesn't double, there's no telling whether your new
-entry will be inserted before or after the current iterator position.
+The easy answer is "Don't do that!"
-Either treasure up your changes and make them after the iterator finishes
-or use keys to fetch all the old keys at once, and iterate over the list
-of keys.
+If you iterate through the hash with each(), you can delete the key
+most recently returned without worrying about it. If you delete or add
+other keys, the iterator may skip or double up on them since perl
+may rearrange the hash table. See the
+entry for C<each()> in L<perlfunc>.
=head2 How do I look up a hash element by value?
=head1 NAME
-perlfaq6 - Regular Expressions ($Revision: 1.26 $, $Date: 2004/10/25 18:47:04 $)
+perlfaq6 - Regular Expressions ($Revision: 1.27 $, $Date: 2004/11/03 22:52:16 $)
=head1 DESCRIPTION
but don't get your hopes up. Until then, you can use these examples
if you really need to do this.
-Use the four argument form of sysread to continually add to
+If you have File::Stream, this is easy.
+
+ use File::Stream;
+ my $stream = File::Stream->new(
+ $filehandle,
+ separator => qr/\s*,\s*/,
+ );
+
+ print "$_\n" while <$stream>;
+
+If you don't have File::Stream, you have to do a little more work.
+
+You can use the four argument form of sysread to continually add to
a buffer. After you add to the buffer, you check if you have a
complete line (using your regular expression).
=head1 NAME
-perlfaq7 - General Perl Language Issues ($Revision: 1.17 $, $Date: 2004/10/19 22:53:50 $)
+perlfaq7 - General Perl Language Issues ($Revision: 1.18 $, $Date: 2004/11/03 22:54:08 $)
=head1 DESCRIPTION
no warnings; # temporarily turn off warnings
$a = $b + $c; # I know these might be undef
}
+
+Additionally, you can enable and disable categories of warnings.
+You turn off the categories you want to ignore and you can still
+get other categories of warnings. See L<perllexwarn> for the
+complete details, including the category names and hierarchy.
+
+ {
+ no warnings 'uninitialized';
+ $a = $b + $c;
+ }
If you have an older version of Perl, the C<$^W> variable (documented
in L<perlvar>) controls runtime warnings for a block: