Help for the perl read file

Discussion in 'Perl Misc' started by yezi, Aug 2, 2005.

  1. yezi

    yezi Guest

    Hi, everyone :

    MY program is following:

    #!/usr/bin/perl
    use warnings;
    use strict;
    $address="./testdownload.txt";
    open ADDRESS,$address or die " can not open the file ${address}";

    while(<>)
    {
    $cmdline="tcpdump -i etho src host $_ -w ${1}.dmp";
    system($cmdline);

    print "Processing wget.";
    $cmdline = "wget http://$_ -q ";
    system($cmdline);
    print "done ...wget..";
    }

    I try to execute the file, the output is like:

    Global symbol "$cmdline" requires explicit package name at trial1.pl
    line 11.
    Unrecognized character \xE2 at trial1.pl line 11.


    I can not understand that. thanks for any help. I am new one of perl
     
    yezi, Aug 2, 2005
    #1
    1. Advertising

  2. yezi

    yezi Guest

    Thanks . I correct the program add the " my " before the each global
    variable. Now the first warning dispears, but the second \xE2 still
    exist. confused
     
    yezi, Aug 3, 2005
    #2
    1. Advertising

  3. yezi

    Brian Wakem Guest

    yezi wrote:

    > Thanks . I correct the program add the " my " before the each global
    > variable. Now the first warning dispears, but the second \xE2 still
    > exist. confused



    Find the line with the invalid char, delete all whitespace on that line and
    replace with spaces as necessary. Or, if the line contains nothing, delete
    it.

    This can happen when you copy and paste from strange sources.



    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    Brian Wakem, Aug 3, 2005
    #3
  4. yezi

    yezi Guest

    Right , why I input the command not copy, it is solved. Thanks.
    Brian Wakem wrote:
    > yezi wrote:
    >
    > > Thanks . I correct the program add the " my " before the each global
    > > variable. Now the first warning dispears, but the second \xE2 still
    > > exist. confused

    >
    >
    > Find the line with the invalid char, delete all whitespace on that line and
    > replace with spaces as necessary. Or, if the line contains nothing, delete
    > it.
    >
    > This can happen when you copy and paste from strange sources.
    >
    >
    >
    > --
    > Brian Wakem
    > Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    yezi, Aug 3, 2005
    #4
  5. yezi

    yezi Guest

    Right , when I input the command not copy, it is solved. Thanks.
    Brian Wakem wrote:
    > yezi wrote:
    >
    > > Thanks . I correct the program add the " my " before the each global
    > > variable. Now the first warning dispears, but the second \xE2 still
    > > exist. confused

    >
    >
    > Find the line with the invalid char, delete all whitespace on that line and
    > replace with spaces as necessary. Or, if the line contains nothing, delete
    > it.
    >
    > This can happen when you copy and paste from strange sources.
    >
    >
    >
    > --
    > Brian Wakem
    > Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    yezi, Aug 3, 2005
    #5
    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. dpackwood
    Replies:
    3
    Views:
    1,862
  2. Replies:
    3
    Views:
    551
    John W. Krahn
    Apr 7, 2006
  3. Sreejith K
    Replies:
    24
    Views:
    1,087
    Sreejith K
    Mar 24, 2009
  4. Alex Dowad
    Replies:
    4
    Views:
    316
    Michel Demazure
    May 1, 2010
  5. Ram
    Replies:
    3
    Views:
    278
    Tad McClellan
    Apr 26, 2007
Loading...

Share This Page