Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: how to skip certain lines and check for blank ones?

by mickeyn (Priest)
on Oct 31, 2006 at 07:30 UTC ( #581441=note: print w/replies, xml ) Need Help??


in reply to how to skip certain lines and check for blank ones?

first of all, read perlre.

a code that may suit your purpose might be something like:

my $INFILE_file_name = 'your_file'; open my $INFILE, '<', $INFILE_file_name or die "$0 : failed to open input file $INFILE_file_name : $ +!\n"; while (<$INFILE>){ next if ( m{ \A \s* # }x); ... your code here ... } close $INFILE or warn "$0 : failed to close input file $INFILE_file_name : $ +!\n";

HTH,
Mickey

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://581441]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2016-12-05 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (89 votes). Check out past polls.