Yes, it should work; but, strangely, it doesn’t:
#! perl use strict; use warnings; use Data::Dump; use Win32API::File qw(getLogicalDrives GetVolumeInformation); my @drives = getLogicalDrives(); for my $d (@drives) { # my @x = (undef) x 7; my @x; $#x = 6; # dd \@x; GetVolumeInformation($d, @x); print "$d $x[0] ($x[5])\n"; }
Output:
1:16 >perl 1442_SoPW.pl Modification of a read-only value attempted at C:/Perl/Strawberry/stra +wberry-perl-5.22.0.1-64bit-PDL/perl/lib/Win32API/File.pm line 269. 1:16 >
But with the line dd \@x; uncommented, it does work:
1:16 >perl 1442_SoPW.pl [undef, undef, undef, undef, undef, undef, undef] C:\ (NTFS) [undef, undef, undef, undef, undef, undef, undef] D:\ () [undef, undef, undef, undef, undef, undef, undef] E:\ () 1:16 >
What’s going on?
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^2: What does my @x= (undef)x7; do?
by Athanasius
in thread What does my @x= (undef)x7; do?
by gepebril69
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |