Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Useless Program

by Punto (Scribe)
on Jun 01, 2000 at 13:24 UTC ( [id://15807]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Useless Program

Also, I guess it'd be faster if you chop the last character of the line ("\n") and then compare with the name, like this:
#open the file while ($name_on_file = <FILE>) { chop $name_on_file; if ($name eq $name_on_file) { #found the name exit; }; }; #ask for the name, and everithing

Replies are listed 'Best First'.
RE: Re: Useless Program
by Aighearach (Initiate) on Jun 02, 2000 at 02:00 UTC
    chop should be changed to chomp, as chomp is safe, and will only chop the record seperator. ( newline, unless you changed the value of $/ )
    Paris Sinclair    |    4a75737420416e6f74686572
    pariss@efn.org    |    205065726c204861636b6572
    I wear my Geek Code on my finger.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://15807]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.