in reply to printing values within a given range

Short answer: s/gt/>/; s/le/<=/;
#!/usr/bin/perl use strict; use warnings;
Very good!
my $input = $ARGV[0]; open(INPUT, "$input") || die "Oops!: Can't open file: $!\n"; my @inputfile = <INPUT>; for(my $j = 0; $j < @inputfile; $j++)
It's generally recommended, and for good reasons (that I'm not explaining here - but about which I can expand, if needed), to
  1. avoid slurping in files in list context, if possible,
  2. to use perl-like for loops rather than C ones.
Now, there are indeed situations in which it is really convenient not to stick to these recommendations. But that doesn't appear to be your case.

Also, nothing wrong with the above logic, per se, but what about a simple

while (<>) { # ... }
instead?

Update:

I have a text file which is nothing more than a list of numbers. I would like to print these numbers if they are between -130 and -125 in value. Unfortunately my current code is not working ... it's printing out all the values in the text file regardless of whether they are between -130 and -125 or not.
Your current code doesn't match exactly this description. However The following minimal example should:
#!/usr/bin/perl -ln use strict; use warnings; print if -130 < $_ and $_ < -125; __END__

Replies are listed 'Best First'.
Re^2: printing values within a given range
by Angharad (Pilgrim) on May 03, 2005 at 14:21 UTC
    I'm sorry, but I have no idea what this is Blazar. Thanks for the suggestion though.
      In turn I have no idea "what this is" is.

      Update: I can understand that the OP may have wanted to downvote this, but I don't think it's pointless to complain about badly written posts. For it's not a good practice to post a comment to a whole node without quoting the exact part of it the cmt itself refers to. When it's not obvious, that is - and here it seems to me it is not, by any means. YMMD