Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 scrutinizing the Monastery: (10)
As of 2015-07-04 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls