Hey perl,
Monday, July 02, 2001, 5:21:16 AM, my MUA believes you used
(X-Mailer not set) to write:
pdo> hi,
pdo> I want to do this :
pdo> i have some servers where i want to check if some files exists and the user
pdo> must put the all path with the name of the file ...
pdo> use strict;
pdo> #that's the file where my servers are ...
pdo> open (LISTESERVEUR, "c:\\perl\\presence\\listeserveur.txt") || die "Ne peut
pdo> ouvrir le fichier Listeserveur.txt ! V�rifier qu'il existe sous
pdo> c:\perl\presence:$!";
pdo> @serveurstab=<LISTESERVEUR>;
pdo> Close(LISTESERVEUR);
open (RESULT,">>>c:\\perl\presence\\resultat.txt");
pdo> print "Fichier recherch� (sous la forme Nom_fichier.extension : \n\n";
pdo> $fichier=chop(<STDIN>);
pdo> print "Chemin complet :\n\n";
pdo> $path=chop(<STDIN>);
pdo> foreach $ligne (@serveurstab)
pdo> {
pdo> chop($ligne);
pdo> but how to change the path ... because the user will put
pdo> c:\folderone\filetwo.txt but i have to write
pdo> \\\\server\\c\$\\folderone\\filetwo.txt
pdo> If someone can help me ...
I would probably use chomp; instead of chop;
and you could use a regex like this
print "Fichier recherch� (sous la forme Nom_fichier.extension : \n\n";
$fichier=chop(<STDIN>);
$fichier =~ s/\\/\\\\/; # to change \ to \\
$fichier =~ s/c\:/\\\\server\\c\$/; # to change c: to \\\\server\\c\$
--
[EMAIL PROTECTED]
Using The Bat! (http://www.ritlabs.com/the_bat/) eMail v1.53d
Windows NT 5.0.2195 (Service Pack 1)
The days of the digital watch are numbered.