[Perl] Funcion getdrive()

Iniciado por BigBear, 12 Octubre 2011, 16:44 PM

0 Miembros y 1 Visitante están viendo este tema.

BigBear

Con esta funcion podran tener el tipo de disco que se e esta ejecutando actualmente (c:/ o el que sea)


Código (perl) [Seleccionar]
#By Doddy H
use Cwd;


sub getdrive {

$path = getcwd();

if ($path=~/(.*):\/\//ig or $path=~/(.*):\//) {
return $1.":/";
}

}


Ejemplo de uso

Código (perl) [Seleccionar]

print getdrive();