There are some perl files, which I have to convert them to python. Reading perl concepts and understanding.
some_file.pl
use Cwd qw(realpath cwd);
realpath( $0 ) =~ /(.+)\/[^\/]+$/;
require "some_other.pl";
use warnings;
use strict;
sub sub_routine1 {
my ($a) = @_;
# Do something
}
sub sub_routine2 {
my ($b, $c) = @_;
# Do something
}
sub sub_routine3 {
my ($c, $d, $e) = @_;
# do something
}
if (!caller) {
# Variable decalarations
# Do something
}
- In the above code, what does
(!caller)
mean ? How can I use that in python or any equivalent ? - In second line, I guess it's matching reg-ex pattern. But what does this exactly mean
realpath( $0 ) =~ /(.+)\/[^\/]+$/;