dallok has asked for the wisdom of the Perl Monks concerning the following question:

Make this a little more clear
open me, '>f:\scripts\text\nodeup.txt'; print me "$ARGV[1] $ARGV[2] is UP on $ARGV[0].\n"; close me $ROUTE="myfile" open route, $ROUTE or die " can't $route\n"; @lines=<ROUTE> my $TEST = $ARGV if (grep {$test eq $ARGV} @lines) { do command here} close ROUTE; exit 0;
[Note: edited by the Editor to make it a little clearer.]

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: ON the ARGV again
by arturo (Vicar) on Nov 01, 2000 at 01:31 UTC

    To help those that follow me ... dallok: read the site FAQ, especially the bits regarding posting. You need to enclose your code in <code> and </code> tags for it to be readable.

    Separating your lines *AS WRITTEN* (and this is at best a guess, since you don't have semicolons there), this is what your code looks like.

    open me, '>f:\scripts\text\nodeup.txt'; print me "$ARGV1 $ARGV2 is UP on $ARGV0.\n"; close me $ROUTE="myfile" open route, $ROUTE or die " can't $route\n"; # here, I can't even guess with any confidence @lines= my $TEST = $ARGV if (grep {$test eq $ARGV} @lines) { do comman +d here} close ROUTE; exit 0;

    First use strict and run under -w (put -w on the #! line). It will make your life so much easier.

    Second, while *I* have an idea because I was reading the chatterbox, others don't. Your question there was "how do I make $ARGV[0] and friends more permanent?" The answer to that question is simple, but as usual TMTOWTDI

    my ($first_arg, $second_arg, $third_arg) = @ARGV[0..2];

    Originally posted as a Categorized Answer.