in reply to Re^2: Reprinting Text With Changing Fields
in thread Reprinting Text With Changing Fields

my @node_number = do { local $/; split ' ', <> }; # etc.

the lowliest monk

Replies are listed 'Best First'.
Re^4: Reprinting Text With Changing Fields
by awohld (Hermit) on Apr 20, 2005 at 19:12 UTC
    So I need it to take @ARGS or the "<" redirect. If there aren't @ARGS or a "<" I need it to print a message saying "use args or <". I think I'm on the right track but it hangs if I don't "<" any text file in. I can't really get it to work.

    So I have:

    if(@ARGV) { my @node_numbers= @ARGV} else { my @node_numbers = do { local $/; split ' ', <> };} if (!@node_numbers) { print <<"EOF"; ##################################### # # use args or < a text file # ##################################### EOF die; } # Do rest of code after here using @node_numbers