Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Perl: how to insert words at the end of each line and open the file?

by WWq (Novice)
on Nov 01, 2013 at 02:39 UTC ( #1060689=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl: how to insert words at the end of each line and open the file?
in thread Perl: how to insert words at the end of each line and open the file?

Thank you for guidance. I keep the library names in an array and try to open each of them to do further editing. It seems I cannot open the file directly using file handle. I will be very much appreciate if you shed light on this.Thanks.

while ($line = <CF>) { @arr2 = @empty_arr; if ($line =~ /(\S+)/) { $libn = "$1.lib"; #print "$libn\n"; push (@arr2,$libn); #print "@arr2\n"; } } foreach $libn (@arr2) { open (VI,"$libn") || die "ERROR: can't read $libn\n"; #print"$libn\n"; if ($line =~ m/(Car code:)((.*))/) { $a = $line; .... .. }


Comment on Re^2: Perl: how to insert words at the end of each line and open the file?
Download Code
Re^3: Perl: how to insert words at the end of each line and open the file?
by Anonymous Monk on Nov 01, 2013 at 02:48 UTC
      Thank you.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1060689]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-10-24 23:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (138 votes), past polls