各位大哥,小弟最近有个东西要在windows上面用到perl。 假设有个程序叫abc。exe, 我可以在 windows的cmd 下面, cd c:\ abc 参数 就可以运行了。 但是如果把它写入abc.pl,它就总是提示有错,想请问各位大哥,应该怎么引入这个执行文件啊? 我写test.pl print "Hello World.\n";---没有问题 我写test.pl cd c:\; abc 参数; 它就会说“Do you need to predeclare abc?” 先谢谢了
by chinasg - Perl - 2009-02-13 13:40:14 阅读(2165) 回复(6)
最近在学习perl,就用perl写了一个监控windows主机的脚本,大家给看看 [code] #!/usr/bin/perl -w use Win32::OLE qw[in]; my $host = $ARGV[0] || '.'; my $wmi = Win32::OLE->GetObject( "winmgmts://$host/root/cimv2" ) or die Win32::FormatMessage( Win32::OLE::LastError() ); my %instances = ( Win32_PhysicalMemory => \&get_pmem, Win32_PerfRawData_PerfOS_Memory => \&get_amem, Win32_Processor => \&get_load...
求win下,perl有关arp的操作或者模块? 因为要用到arp,但我在win下Activeperl 5.8.8 Build 822好像没这样的模块,郁闷!
#!/usr/bin/perl use strict; my $LocalIp="192.168.1.79"; my $file="/tmp/mac.txt"; system("sudo nmap -sP 192.168.1.0/24 > $file"); open(OLD,$file); my @content=;close OLD; open(NEW,">$file"); foreach my $con (@content) { if( $con =~ /Nmap/ig){$con="";} if( $con =~ /$LocalIp/ig){$con="";} if($con =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) { print "$1\.$2\.$3\.$...
#!/usr/bin/perl use strict; my $LocalIp="192.168.1.79"; my $file="/tmp/mac.txt"; system("sudo nmap -sP 192.168.1.0/24 > $file"); open(OLD,$file); my @content=;close OLD; open(NEW,">$file"); foreach my $con (@content) { if( $con =~ /Nmap/ig){$con="";} if( $con =~ /$LocalIp/ig){$con="";} if($con =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) { print "$1\.$2\.$3\.$4\t"; print NEW "$...
本帖最后由 chxlinux 于 2011-04-09 20:37 编辑 不知道是否被别的限制了 还是怎么地 用nslookup可以正常解析 但是打不开网页 也上不了QQ 在做lvm实验时 报错了 要怎么解决啊
arp: 1:The device driver software never looks at the destination IP address in the IP datagram. 2:Address resolution provides a mapping between the two different forms of addresses: 32-bit IP addresses and whatever type of address the data link uses. 3:arp -a, arp -d; sh arp, clear arp arp packets format: 6B 6B 2B(arp) 2B(Ethernet) 2B(IP) 1B 1B 2B 6B ...