Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: What is the error in my script or file setup?

by tachyon (Chancellor)
on Jul 30, 2001 at 18:37 UTC ( #100883=note: print w/ replies, xml ) Need Help??


in reply to What is the error in my script or file setup?
in thread File Input and Output

This works:

@list = qw( fred 20.4 harv 5.6 tony 5.13 dennis 401.1 ); $i="harv"; foreach $list(@list) { if($i eq $list) { print "YES!\n"; } }

Suggest you add open (FILE, "input.dat") or die "Oops can't open input.dat Perl says $!\n"; which will *probably* tell you that perl cna't find your file. Also you don't need to push your data into an array as you do but that is by the by.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


Comment on Re: What is the error in my script or file setup?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-08-20 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (113 votes), past polls