Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: data inside file

by AcidHawk (Vicar)
on May 11, 2004 at 20:16 UTC ( #352576=note: print w/replies, xml ) Need Help??

in reply to data inside file

I am not sure what you are trying, but a few comments.

  • You declare my $empNUM; but later refer to $empNum - Possible Type ??
  • since you are using my try to be consistant.. so you line foreach $line (@line) would look like foreach my $line (@line)
  • instead of exiting I.e. exit 0; you might have employees to process after you found a match so instead do a next
  • So you might end up with something like

    my $empNUM; open(DATA, "data") or die ; open(UPDAT, ">updated") or die; while(<DATA>) { my @line = split(/\s+/, $_); #Assuming your file is split on multi +ple spaces..? if ($line[2] eq $empNUM){ next; } else { print UPDAT "$_"; } } close(DATA); close(UPDAT);
    Update: Removed the foreach as it is not necessary..
    Of all the things I've lost in my life, its my mind I miss the most.

    Log In?

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: note [id://352576]
    Discipulus IE just maps to id est in my mind .. ;=)
    [Corion]: marto: I believe nowadays, at least window.opener should not be set anymore (except maybe within the same domain)
    [Corion]: But I wouldn't really know as I don't use iexplore much (except at $work) and mostly surf with JS disabled (except at $work :) )
    [marto]: yeah, this is at work, where some intranet app launches links via When users close the intranet page so that only the new JS opened windows exist, clicking URLs in an email (or whatever) don't open

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (7)
    As of 2018-03-21 11:47 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (267 votes). Check out past polls.