add a "suffix" to a variable in a array

L

Laura

I dont know if I can explain this correctly by here goes.
I am trying to write a perl program that takes a file let say it looks
like this...
xxxx001,00 0 05 21,TELN NOT
xxxx002,00 0 01 30,TELN NOT
xxxx008,00 0 04 15,TELN NOT
xxxx013,00 0 02 30,CUST HAS
xxxx015,00 0 10 22,CUST HAS

I want to also insert a few things to this file...
I want to prompt user to enter in
print "Enter BLD:"; $bld=<STDIN> ; chomp $bld;
print "Enter ROOM:"; $ROOM=<STDIN> ; chomp $ROOM;

Also I want a areacode fixed to the first column so when all is said
and done, I have part of the script but can not add the areacode to
it???

#!/opt/perl/bin/perl
$acode="204";
print "Enter BLD:"; $bld=<STDIN> ; chomp $bld;
print "Enter ROOM:"; $room=<STDIN> ; chomp $room;
while(<ARGV>) {
chomp;
@a=split(",",$_);
print join(",",$a[0],$bld,$room,$a[1],$a[2],$a[3],"\n") ;

How do I add 204 at the beginning of the [1]?

204xxxx001,EAST_BLD,ROOM1,00 0 05 21,TELN NOT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top