B
broeisito
Hello,
I wrote the following code to read what processor is in a linux box.
But I get the following error:
Use of implicit split to @_ is deprecated at cpu.pl line 17.
Can someone possibly explain to me what I'm doing wrong here?
Here is the code.
================== begin ======================
#!/usr/bin/perl
use strict;
use warnings;
my $CPU_FILE = "/proc/cpuinfo";
if(-e $CPU_FILE && -r $CPU_FILE && -f $CPU_FILE)
{
open CPU, $CPU_FILE;
}
while(<CPU>)
{
if(/model.name/)
{
split;
print "The processor is an $_[3] $_[4] $_[5] running at $_[7]\n";
}
}
close CPU;
================== end ======================
BTW... this is my first perl code... so don;t flame my programming
style yet!!
Cheers,
Broeisi
I wrote the following code to read what processor is in a linux box.
But I get the following error:
Use of implicit split to @_ is deprecated at cpu.pl line 17.
Can someone possibly explain to me what I'm doing wrong here?
Here is the code.
================== begin ======================
#!/usr/bin/perl
use strict;
use warnings;
my $CPU_FILE = "/proc/cpuinfo";
if(-e $CPU_FILE && -r $CPU_FILE && -f $CPU_FILE)
{
open CPU, $CPU_FILE;
}
while(<CPU>)
{
if(/model.name/)
{
split;
print "The processor is an $_[3] $_[4] $_[5] running at $_[7]\n";
}
}
close CPU;
================== end ======================
BTW... this is my first perl code... so don;t flame my programming
style yet!!
Cheers,
Broeisi