perlfaq7: How do I skip some return values?
[email protected] (_brian_d_foy)
| Newsgroups | perl.documentation,perl.cvs.perlfaq |
|---|---|
| Message-ID | <160620022341438460%[email protected]> |
for your comments
Index: perlfaq7.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq7.pod,v
retrieving revision 1.8
diff -u -d -r1.8 perlfaq7.pod
--- perlfaq7.pod 26 Mar 2002 15:48:32 -0000 1.8
+++ perlfaq7.pod 17 Jun 2002 04:38:53 -0000
@@ -81,6 +81,11 @@
Another way is to use undef as an element on the left-hand-side:
($dev, $ino, undef, undef, $uid, $gid) = stat($file);
+
+You can also use a list slice to select only the elements that
+you need:
+
+ ($dev, $ino, $uid, $gid) = ( stat($file) )[0,1,4,5];
=head2 How do I temporarily block warnings?