XP is just a number | |
PerlMonks |
Re^5: How to ask user for file name and save the output to a new text fileby Discipulus (Canon) |
on Jun 19, 2017 at 09:22 UTC ( [id://1193090]=note: print w/replies, xml ) | Need Help?? |
perl is human friendly; infact a comma is missing after the decalration of the lexical filehandle name:
PS pay attention: while(<$writehandle>) will never work: the pointer is to the end of file when you try to reaad from that handle: You can use seek to rewind it but probalby it will be better another strategy: instead of writing to a file accumulate the output into an array. Then you can foreach my $line (@out_array){ # do whatever you want... PPS if you provide an example data you are grabbing and the expected output for sure some monk can suggest a better way to handle your data: I suspect you have a filehandle or two more than necessary.. L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|