> I encounter fail message when using the head and tail function.
> Is it able to have variables as parameters
> 
> the line :
> $result = head -n $get $Alarm_File;
> 
> where $get is the number of lines and $Alarm_File is the file name.
> when it execute...error message come "Unrecognized file test: -n at
> GenAlarm.pl line 70."
> Thanks a lot.
> Kan

If it was a function you'd call it like this :

$result head '-n', $get, $Alarm_File;

but since it is an EXTERNAL program (or a command of the shell) you 
have to call it like this :

 $result = `head -n $get $Alarm_File`;

Notice the backticks !

Jenda
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to