if (-e $name) {basically check if the file exists or not. And you know about this already I suppose.
-e ($name = $name."_$i")in the for loop basically loop over the file. It has the same meaning as if you do this:
Finally, read -X.my $name = $name."_$i"; # input file name open ( INF, '<', $name ) or croak "$0 : failed to open output file $name : $!\n"; while(<INF>) { # Do something } close ( INF ); # close input file
In reply to Re: unique filename
by neversaint
in thread unique filename
by lax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |