Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Cannot work on second file after reading first file.

by davido (Cardinal)
on Feb 28, 2014 at 19:44 UTC ( [id://1076608]=note: print w/replies, xml ) Need Help??


in reply to Re: Cannot work on second file after reading first file.
in thread Cannot work on second file after reading first file.

That's exactly why I wanted to print "(@{$head})". It would tell me if $head contained stuff that shouldn't be there. The OP told me the following, "When I ran the script it printed: Field names detected: (# de tienda  tipo  ubicacion". I should have known -- because he didn't show me the closing paren ')' -- that his report to us was incomplete, and should have suspected that it lacked exactly the piece of information we were looking for.

That doesn't excuse my not having seen "undef $/" earlier in the script, but had he reported the full output, or had I noticed that his report was incomplete, it would have led us to look for the modification of $/ sooner even though it was at first not noticed.


Dave

Replies are listed 'Best First'.
Re^3: Cannot work on second file after reading first file.
by 1straw (Novice) on Feb 28, 2014 at 20:09 UTC

    Hi Dave:

    I still don't understand what went wrong when I followed your instructions. I did mention the odd open parenthesis "(" without a closing parenthesis, but that's definitely all that was outputed. I just tried again w/ undef $/; and I can confirm (Li Stores: and FF Stores was the original output before implementing your code, it was still there afterward, but I didn't think it was important to mention):
    x@y:~/example$ perl example Field names detected: (# de tienda tipo ubicacion Li stores: FF Stores: x@y:~/example$

    I post this out of curiosity & to avoid making the same mistake in the future

    Thank you for your help, I really appreciate the time you took to help me figure this out!!

    1straw
Re^3: Cannot work on second file after reading first file.
by McA (Priest) on Feb 28, 2014 at 19:49 UTC

    After seeing the output of the first line it was so obvious in combination that we've seen $/. But without that I would have read over this piece of code many times without seeing the problem.

    But the next time my presented solution will be a one-liner and not a whole story to see myself being late in the thread... ;-)

    Best regards
    McA

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-23 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found