Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Some Basic Help.

by kcott (Chancellor)
on Sep 24, 2012 at 08:15 UTC ( #995308=note: print w/replies, xml ) Need Help??


in reply to Some Basic Help.

G'day invaderzard,

I see a number of issues here:

  • use Modern::Perl has no terminating semicolon.
  • Your code for opening files is not the best. Take a look at open.
  • $1 holds data you've captured with a regexp. See perlre.
  • If you follow the advice in the open documentation, you can write your while loops as while (my $line = <$file_handle>) { ... } which should solve your main problem.

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995308]
help
Chatterbox?
[talexb]: Great quote from Re: (OT) Motivating the Unmotivated Programmer: "As Weinberg suggests, when a programmer becomes irreplaceable, it's time to replace him."

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-07-25 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (377 votes). Check out past polls.