Help for the perl read file

Y

yezi

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
 
Y

yezi

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
 
B

Brian Wakem

yezi said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top