Help for this page

Select Code to Download


  1. or download this
    $data = <<'DATA';
    foo 1.1.1.1 foo
    ...
    
    print "While works and gives:\n";
    print "$_\n" for @ips;
    
  2. or download this
    $data = <<'DATA';
    foo 1.1.1.1 foo
    bar 22.22.22.22 bar
    ...
    
    print "Foreach now gives:\n";
    print "$_\n" for @ips;
    
  3. or download this
    open FILE, "<path/to/file" or die "Oops, Perl says: $!";
    {
    ...
        $data = <FILE>;
    }
    close FILE;