
March 4th, 2013, 05:51 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 14
Time spent in forums: 2 h 49 m 34 sec
Reputation Power: 0
|
|
|
Perl file and split questions
Code:
my ($bumpFileVolume,$bumpFileDir,$name) = File::Spec->splitpath($bumpFile);
my @workDirArr = ($bumpFileVolume,$bumpFileDir);
my $workDir = File::Spec->catdir(@workDirArr);
chdir $workDir or die "$0 failed to chdir to working dir $workDir";
system ("sort -k 1,1 -k 4n -T $workDir $name >tempLoc_$name")==0 or die "$0 failed to sort $name";
open (BRK, "tempLoc_$name") or die "$0 failed to open file tempLoc_$name";
open (OUTTWO, ">loc_analyze_$name") or die "$0 failed to open file loc_analyze_$name";
I'm a little confused as to whats happening here. What does it mean to create the variable $name attach it to the file I assume is $bumpfile and then use in as the part of loc_analyze_$name or tempLoc_$name? Are they creating a new file or simply opening up an old one?
Also for
Code:
#LINE: while (@bumps){
LINE: while (<FIL>) {
my $line2 = $_;
chomp $line2;
my @parts = split;
my $rom_ref = $parts[0];
my $signal = $parts[1];
I'm assuming the array parts is from FIL being split. Is this correct?
|