in reply to Re: elementary hash
in thread elementary hash, STDIN questions

Hmmm... responds with "Use of uninitialized value at line while (<>) {".   The .bak file is created, but the original is left as a zero-byte file.

Perl 5.005.03
    cheers,
    ybiC

  • Comment on RE: (2) elementary hash (uninitialized value...)

Replies are listed 'Best First'.
RE: RE: (2) elementary hash (uninitialized value...)
by adamsj (Hermit) on Sep 12, 2000 at 02:22 UTC
    I dumped the -p switch and put an explicit print statement in and that worked...but it seems like the -p _ought_ to work. I _think_ it doesn't, though, because the Camel book says -p puts an assumed loop around the script with a print in the equivalent of a continue block, so the print would only be seen once. Now, if you remove the while loop and just do this:
    #!/usr/bin/perl -p -i.bak my $kill = "what|ever"; s/$kill//go; s/^\s+//g;
    I believe it'll work..it's weird, but it works.