Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^4: Lose first element of hash in hash ..

by theantler (Sexton)
on Mar 11, 2010 at 16:14 UTC ( [id://828069]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Lose first element of hash in hash ..
in thread Lose first element of hash in hash ..

ikegami, jethro, thanks for your kind help. Ok, that is pretty crazy but it makes sense, and I suspected something along those lines (that it is stored as \nbed instead of bed. But how can it? It is read from a text file composed in vi that reads:
bed-There is some sheets and a pillow here-pillow-Nice soft pillow ..- +sheets-Long white sheets .. You slept in them last night.
I dont know where the \n comes from. I would suspect that the \n would terminate the line (from a CR) not initiate it. ta

Replies are listed 'Best First'.
Re^5: Lose first element of hash in hash ..
by jethro (Monsignor) on Mar 11, 2010 at 16:32 UTC

    Well, if you do

    cat rooms.txt

    what do you see?

    > cat rooms.txt bed-There is ...

    or

    > cat rooms.txt bed-There is ...

    If you see the second variant, then you have a \n at the start of your file. Maybe you should read the file line by line, or sanitize your input.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-18 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found