$filename = "/home/Ram/Desktop/Perl_file.txt";
open(my@array_a = @array[0..5], '>', $filename) or die "Could not open
+ file '$filename' $!";
print @array_a ;
close @array_a;
print "done\n";
but it showing error like
first five string:abcdef
ghi
ijklmnop
q
rstu
vwxy
Can't use string ("6") as a symbol ref while "strict refs" in use at array.pl
line 22 (#1)
(F) Only hard references are allowed by "strict refs". Symbolic
references are disallowed. See perlref.
Uncaught exception from user code:
Can't use string ("6") as a symbol ref while "strict refs" in use at array.pl line 22.
at array.pl line 22 . Why it showing error? Please let me know
|