Help for this page

Select Code to Download


  1. or download this
    open FILEHANDLE, filename;
    
  2. or download this
    open FILE, "myfile" or die "Couldn't open: $!";
    @lines=<FILE>; #get all the lines from the file
    close FILE;
    
  3. or download this
    open FILE2, "myfile2" or die "Couldn't open: $!";
    while(<FILE2>){  #reads in from the file a line at a time and puts it 
    +in the default variable
      print $_;      #print the default variable $_ which the line is stor
    +ed in.
    }  
    close FILE2;