Home > other >  Read the specified file perl custom PM?
Read the specified file perl custom PM?

Time:12-19

If inscribe, want to write a piece of code, through the new () to create a new object, read the specified file, but has said can't find file,
Perl small white, the great god give directions TT

This is the part of the PM read the file:
 sub new {
My $file_sam=shift;
The open, IN "& lt; $file_sam "or die $! ;
My (@ array, % quality);
While (& lt; IN>) {
Chomp.
@ array=split/\ t/, $_;
if(!/^ \ {@/)
$quality {$array [9]}.="$array [4]".
}
Close IN;
Return bless % quality;
}
}


This is a part of the script calls the PM:
 #! The/usr/bin/perl -w 
Use strict;
The BEGIN {push (@ INC, 1217 'C: \ work'); }
Use Sam;

My object %=new Sam (" sample9. Sam ");
  • Related