CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Use of uninitialized value problem in Perl script: Edit Log



digioleg54
User

Jun 9, 2017, 8:37 AM


Views: 2415
Use of uninitialized value problem in Perl script

I continue my last post. I have a code:

Code
foreach my $line (@records) { 
print "We are in the record $line\n";
chop;
if (/ TBA/) {
my$ln_tp=$_;


It is reading line and print it, however in the error_log I see

Code
Use of uninitialized value $_ in scalar chop at tests1.pl line 47. 
Use of uninitialized value $_ in pattern match (m//) at tests1.pl line 48.

47 - chop, 48 if

Could you please correct the code, if it is wrong?
This is one of the line

Code
CUSIP|20170504|DMG |100.6340625||1544000 We are in the record CUSIP|20170504|DMG |100.6340625||1544000


The code is not mine, I have to fix it. And I don't understand what is

Code
 if (/ TAB/

. It is trying to compare something with TAB? I don't see, what can be compare like that
Thanks


(This post was edited by digioleg54 on Jun 9, 2017, 9:14 AM)


Edit Log:
Post edited by digioleg54 (User) on Jun 9, 2017, 9:14 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives