keraam has asked for the wisdom of the Perl Monks concerning the following question:
And I want to break it apart check if the department number (the 200) is = 100 and then format it like
Singer Samuel 011349786 6Heres what i have so far after looking through man perlre and seeing this method to parse
The errors i get are Use of uninitialized value at program line 15, <EMPLOYEES> chunk 26.#!/usr/bin/perl -w open(EMPLOYEES,"employees") || die "Cannot Open"; while(<EMPLOYEES>){ if(/(..):(..):(..):(..):(..)/){ #Suppost to parse $_ $ID = $1; $DP = $2; $LN = $3; $FN = $4; $NM = $5;} print $ID; # print $DP; # print $LN; # So I can see if a value is there print $FN; # print $NM; # print $LN."\t".$FN."\t".$ID."\t".$NM; } } close(EMPLOYEES)
I get that for all lines i print out the values. Thanks for any help
Edit kudra, 2001-12-22 Changed title, added p breaks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Parsing
by Ovid (Cardinal) on Dec 19, 2001 at 06:52 UTC | |
|
Rescued by a Perl Superhero
by chip (Curate) on Dec 19, 2001 at 12:13 UTC | |
|
Re: Parsing
by hossman (Prior) on Dec 19, 2001 at 12:58 UTC | |
|
Re: Parsing
by Vavoom (Scribe) on Dec 19, 2001 at 10:31 UTC | |
by jynx (Priest) on Dec 19, 2001 at 13:19 UTC | |
|
Re: Parsing
by dragonchild (Archbishop) on Dec 19, 2001 at 19:56 UTC |