knight.of.ni has asked for the wisdom of the Perl Monks concerning the following question:
Hello my friends,
please have patience with me. I'm a bloody perl-beginner :)
My problem:
I have a big file and inside there is an html-file hidden.
My quest:
I want to extract only this html-file from the big file. So I guess I have to search the big file for strings like "<html>" and "</html>".
So far:
I did a little test with a png-file. Here is my code:
#!/usr/bin/env perl use strict; use warnings; open(INPUT, "<test_in.png") or die $!; open(OUTPUT, ">test_out.png") or die $!; while(<INPUT>) { last if /END/; print OUTPUT $_; }; close INPUT; close OUTPUT;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Weird file extraction problem
by GrandFather (Saint) on Jan 13, 2016 at 09:13 UTC | |
|
Re: Weird file extraction problem
by Laurent_R (Canon) on Jan 13, 2016 at 07:28 UTC | |
|
Re: Weird file extraction problem
by Ratazong (Monsignor) on Jan 13, 2016 at 07:20 UTC | |
|
Re: Weird file extraction problem
by hotchiwawa (Scribe) on Jan 13, 2016 at 10:23 UTC |