in reply to Re: Re: Inserting lines in a file with Tie::File if lines don't exist
in thread Inserting lines in a file with Tie::File if lines don't exist

Sure thing.

tie @lines, 'Tie::File', $hostsfile or die ...;

Dev Goddess
Developer / Analyst / Criminal Mastermind

"Size doesn't matter. It's all about speed and performance."

  • Comment on Re: Re: Re: Inserting lines in a file with Tie::File if lines don't exist

Replies are listed 'Best First'.
Re: Re: Re: Re: Inserting lines in a file with Tie::File if lines don't exist
by BrowserUk (Patriarch) on Jan 04, 2004 at 01:41 UTC

    If you really have tie @lines, 'Tie::File', $hostsfile or die ...; then you should change it to something like

    tie @lines, 'Tie::File', $hostsfile or die "Couldn't tie file $hostsfile; $!";

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!

      It worked! It worked! WAHOO!!!! :D

      Thanks!

      Dev Goddess
      Developer / Analyst / Criminal Mastermind

      "Size doesn't matter. It's all about speed and performance."