Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: More Flat-File Database Questions

by eg (Friar)
on Feb 11, 2001 at 12:27 UTC ( [id://57728]=note: print w/replies, xml ) Need Help??


in reply to More Flat-File Database Questions

In other words you want to "Scott Numbers" rather than "item numbers"? You need to edit the check_record subroutine. Change

if (($item_number >=$first) && ($item_number <= $last)) {

to

if (($scottnum >=$first) && ($scottnum <= $last)) {

For what it's worth, I think your script could do with a complete re-write -- it looks like it was originally written for perl 4.

Replies are listed 'Best First'.
Re: Re: More Flat-File Database Questions
by Stamp_Guy (Monk) on Feb 11, 2001 at 20:08 UTC
    Complete Rewrite? You got that right! This was one of my first scripts. It's a modification of a freebie I found. I fully intend on rewriting it, but I'm trying to find out how to do what I said above in this post.

    I know I could change it from $item_number to $scottnum, but that wouldn't work because some of those numbers contain letters in them and there are multiple items for nearly each Scott number. Any other ideas?

      So what does $scottnum actually look like? Can you give some example of the mixing of letters and numbers? If the letters in $scottnum are irrelevant to the selection process, you can quash them out with

      $scottnum =~ tr/0-9//cd;

      or, if the irrelevant bit is at the end of the number, just do the comparisons on the int( $scottnum ).

      It doesn't matter that there are multiple entries for each scott number, since each line is treated independently in the selection process. If you have "100a" and "100b", they'll both be in the range [0, 200].

      Hi Stamp_Guy, i'm trying to make the same database you did, but i'm in troubles with some thimgs. Could you send me code of it, like de CGI and some lines of the txt database? Thanks Miguel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-18 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found