The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello hemantjsr, Like Laurent_R, I don’t understand what you are trying to do. However, in the code posted I do notice a major problem in the use of variables. First, in the lines:
$_ is undefined, so you are immediately deleting the contents of $line and replacing them with undef. (And the line would accomplish nothing, anyway, even if $_ did contain the next element of @lines, as that element has already been stored in $line via the foreach statement.) Second, in the lines:
you are accessing the first and second elements of the array @line. But as this array has never been declared, the substitutions have nothing to work on. Please note that the array @line is an entirely different variable from the scalar $line. (I notice that you do declare a variable my $lines, but that variable is never used.) If you begin your script with:
this will provide some (but not all) of the help you need to identify errors of this kind. See also Perl variable types and perldata. Hope that helps,
In reply to Re: Dear Monks, Have created multiple files from one file ...
by Athanasius
|
|