Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: How do I use the "File::ReadBackwards" and open in "Unicode text, UTF-32, little-endian" mode

by hashperl (Initiate)
on Mar 13, 2013 at 09:18 UTC ( #1023148=note: print w/ replies, xml ) Need Help??


in reply to Re: How do I use the "File::ReadBackwards" and open in "Unicode text, UTF-32, little-endian" mode
in thread How do I use the "File::ReadBackwards" and open in "Unicode text, UTF-32, little-endian" mode

Thanks for your reply sundialsvc4, I think this was the conclusion that I was coming to but it's good to here it from someone else.


Comment on Re^2: How do I use the "File::ReadBackwards" and open in "Unicode text, UTF-32, little-endian" mode
Re^3: How do I use the "File::ReadBackwards" and open in "Unicode text, UTF-32, little-endian" mode
by hashperl (Initiate) on Mar 13, 2013 at 16:16 UTC

    I have found a simple solution for my particular case, as I know that I only want to match certain strings from the log file and none of the match strings will be none ASCII characters.

    I can use the ReadBackwards to read the line in then strip out none ASCII and null characters.

    my $ERRORLINES_IN = File::ReadBackwards->new($logfile) or die "$logfil +e : $!\n"; while (defined($logline = $ERRORLINES_IN->readline)) { $logline =~ s/[^[:ascii:]]//g; $logline =~ s/\0//g;

    It's not a perfect solution but it works for my case.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (17)
As of 2015-07-06 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (82 votes), past polls