Perl Expect send array

Discussion in 'Perl Misc' started by ruud, Feb 22, 2005.

  1. ruud

    ruud Guest

    I am having a logfile called "log".
    I am reading the whole logfile into an array:

    open (FPTR,"/home/ruud/log");
    @logfile = <FPTR>;

    When i do print "@logfile"; i get the correct output.
    But when i want to send the log to an (internal) newsgroup like this:

    $exp->send ("@logfile");
    It adds between every line an enter (\n)

    Is there a way to work around that ?
    --
    Gr. Ruud
    news://news.nl-netwerken.com
     
    ruud, Feb 22, 2005
    #1
    1. Advertising

  2. ruud

    Anno Siegel Guest

    ruud <> wrote in comp.lang.perl.misc:
    > I am having a logfile called "log".
    > I am reading the whole logfile into an array:
    >
    > open (FPTR,"/home/ruud/log");
    > @logfile = <FPTR>;
    >
    > When i do print "@logfile"; i get the correct output.
    > But when i want to send the log to an (internal) newsgroup like this:
    >
    > $exp->send ("@logfile");
    > It adds between every line an enter (\n)
    >
    > Is there a way to work around that ?


    perldoc -f chomp

    Anno
     
    Anno Siegel, Feb 22, 2005
    #2
    1. Advertising

  3. ruud

    ruud Guest

    Anno Siegel wrote:

    >> It adds between every line an enter (\n)
    >>
    >> Is there a way to work around that ?

    >
    > perldoc -f chomp


    Thank you for the help, it's working now.
    --
    Gr. Ruud
    news://news.nl-netwerken.com
     
    ruud, Feb 22, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MarkD
    Replies:
    0
    Views:
    746
    MarkD
    Dec 4, 2003
  2. Simon Strandgaard

    how to expect eof with expect+pty

    Simon Strandgaard, Dec 20, 2006, in forum: Ruby
    Replies:
    4
    Views:
    358
    Simon Strandgaard
    Dec 20, 2006
  3. Graham Wood
    Replies:
    4
    Views:
    109
    Alan J. Flavell
    Sep 5, 2003
  4. Franklin Lee

    Help with Perl Expect.

    Franklin Lee, Feb 26, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    179
    Charles DeRykus
    Mar 1, 2004
  5. Phil
    Replies:
    0
    Views:
    168
Loading...

Share This Page