Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by mickeyn (Priest)
on Oct 31, 2006 at 07:30 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://581441]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-03-19 04:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found