Re: separate input




Cinzia Sala wrote:
Dear all,
I would like to separate my input text DB-file into single files each
containing the information between the two separators "//"


e.g.

dog, cat, home
home, dog, cat
//
pen, pencil, work
//
milk, water, wine
wine, milk, water
//end

I have tried with this:

do {
$/="//\n";
$record= <DBFILE>;
print $record;
} until ($/="//end");

What do you think that line is doing?

I think you meant
until ($record eq '//end');

$record is very different from $/, and = is very different from eq

Paul Lalli

.



Relevant Pages

  • Re: Cat versus cocktail - What would you do?
    ... Oh, see, I'm a dog person, really...it wouldn't even occur to me to disturb ... Downstairs on the kitchen counter is a glass of wine I poured for myself ... On my lap is a very content cat. ...
    (alt.support.stop-smoking)
  • separate input
    ... dog, cat, home ... milk, water, wine ...
    (perl.beginners)
  • Re: separate input
    ... dog, cat, home ... milk, water, wine ...
    (perl.beginners)
  • Re: OT: Cat versus cocktail - What would you do?
    ... The cat finally moved only because the dog came in for a visit. ... didn't want the wine either.... ... DECIDE until the cat finally moved of it's own volition, at which point, I ... On my lap is a very content cat. ...
    (alt.support.stop-smoking)
  • Re: Anybody remember this drink?
    ... Apparently they sell it as cheap wine. ... So while we were all talking about cat piss (something painless and ... No. Dalboz said the cat was drown in water, so I'd imagine he meant wine ...
    (rec.games.computer.ultima.dragons)