Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- use v5.10.0;
- print "Cual es el nombre de tu distribucion de Linux : ";
- my $sistema=<STDIN>;
- chop($sistema);
- given( $sistema ) {
- when('ubuntu') { print "Eres ubuntero :)\n"; }
- when('debian') { print "Eres Debianita :D\n"; }
- when('archlinux') { print "O: Archero\n"; }
- default { print "Usas $sistema\n"; }
- }
- print "Otra prueba :D\n";
- print "Escribe un numero : ";
- my $numero=<STDIN>;
- given($numero) {
- when(/\d/) { print "Bien solo escribiste numeros numeros :D\n"; }
- when(/\D/) { print "Solo numeros |:(\n"; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement