Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: ASCII insert after read

by pc88mxer (Vicar)
on Jul 29, 2008 at 19:40 UTC ( #700908=note: print w/replies, xml ) Need Help??

in reply to ASCII insert after read

An easier way to test for the ASCII character 12 is to use a regex:
if ($line =~ m/\014/) { # $line contains a Control-L }
Update: I guess your approach can work, but it's a little awkward. You are comparing the octal representation of a number (which is a string) to a decimal value. Doing it your way I would have written it:
$test = sprintf("%o", ord $_); if ($test eq "14") { ... }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://700908]
[Corion]: Oh yay. $project has faffed around for 2 years and now pushed a hasty 2 weeks solution into production without telling me. Of course, the new data also needs changes on my side to be processed correctly. Now they try to raise incidents against my ...
[Corion]: ... input systems to make the change outside of the organized project because I don't have ressources for the project to make the change.
[marto]: good morning all

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-08-17 09:14 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (285 votes). Check out past polls.