I am trying to understand some code which is already written..
I am not able to understand
my $l = $0; $l =~ s-/[^/]+/[^/]+$-/lib/perl-;
what is assigned to $0 ? what is - (Hyphen) operator in the expression ? whay $- is used in the expression?
Please explain the ablove 3Qs.
BEGIN {
# figure out our general library path
my $p;
my $l = $0; $l =~ s-/[^/]+/[^/]+$-/lib/perl-;
push @INC,$l;
# add some platform components, based on files
push @INC,"$l/sunos" if ( grep /solaris/,@INC );
push @INC,"$l/csw" if ( grep /csw/,@INC );
push @INC,"$l/i386" if ( grep /i386/,@INC );
push @INC,"$l/x86_64" if ( grep /x86_64/,@INC );
}