Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Generating a List of numbers

by InfiniteSilence (Curate)
on Jan 31, 2012 at 02:50 UTC ( #950861=note: print w/replies, xml ) Need Help??

in reply to Generating a List of numbers

For starters that regex you are using fails. You need two things a) you must learn how to use the Perl debugger and to step through your code. Writing reams of Perl code without the ability to deduce precisely where things are breaking is the path to misery and b) test your regexes:

DB<5> p $_ 5 504 DB<6> if (m/^[\.d\s]+/g){print 1} DB<7> if (m/^[\.d\s\t]+/g){print 1} 1
The line you are looking for has nothing but numbers, spaces, tabs, and periods. My test checks only for that and succeeds. Yours is testing is trying to eliminate lines. That, in itself, is not the reason why it is failing but from the sheer number of alternates you added to the regex it is sloppy. Use regexes to zero in on what you want in a file and less on what you are trying to ignore.

Celebrate Intellectual Diversity

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950861]
[atcroft]: abner: Or are you wanting to do something where you need to bind an array to a placeholder (in which case the bind_param_array method may be of use.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-01-24 04:01 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (202 votes). Check out past polls.