develooper Front page | perl.beginners | Postings from February 2002

Re:A more perlish way

Thread Next
From:
Jorge Goncalvez
Date:
February 6, 2002 06:05
Subject:
Re:A more perlish way
Message ID:
200202061405.PAA18411@cabs40.col.bsf.alcatel.fr
Hi, I have this :
my $program_path = "c:\\cygwin\\bootp\\linux";
	my $Symlink="$program_path\\install.lnk";
	my $Symlink2="$program_path\\linux.ram.lnk";
	my $Symlink3="$program_path\\alize\\install.lnk";
	my $Symlink4="$program_path\\alize\\startup.txt.lnk";
	
if (-e $Symlink)
{
 	system "rm $Symlink";
 }

if (-e $Symlink2)
{
 	system "rm $Symlink2";
 }


if (-e $Symlink3)
{
 	system "rm $Symlink3";
 }


if (-e $Symlink4)
{
 	system "rm $Symlink4";
 }
 
 
 I tried this:
  @Symlink=("$program_path\\install.lnk",
   			 "$program_path\\linux.ram.lnk",
   			 "$program_path\\alize\\install.lnk",
   			 "$program_path\\alize\\startup.txt.lnk");

  foreach (@Symlink)
  {
		if (-e $_)
		{

 			system "rm $_";

 		}
   }
   
  but it seems not to work?Why?
  
  Thanks. 	


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About