in reply to Re: passing values to another perl program
in thread passing values to another perl program

I used the line from above and the line that returned to me is...

sh: -t: not found

below are the two programs, stripped down, that I am trying to run. The first one calls the second, which should print out the values. At this point all that I am trying to accomplish is seeing that the values get over.

Here are the two programs: #!/use/bin/perl -w open(EXT,"< LDB_EXTID.lst") || die "something"; while (<EXT>) { push (@externaluids, $_) || die "dead again"; } close (EXT) foreach $externaluid (@externaluids) { my $output = `ldbtest.pl -e $externaluid -t 123`; #for my testing purposes $counter++; exit if $counter > 10; } exit #program ldbtest is simply... #!/use/bin/perl -w use Getopt::Std; getopt ('et'); print $opt_e print $opt_t exit

Replies are listed 'Best First'.
Re: Re: Re: passing values to another perl program
by arturo (Vicar) on Jul 09, 2001 at 22:16 UTC

    Lemme reiterate Malkavian's suggestion in Re: passing values to another perl program; as we can now tell from your posted code, you're snagging individual lines from the one file, and interpolating those values into your backticks; but as he suggested might be the problem, you've got newlines in there and so the -t is seen as the beginning of a new command. Here's one way to rewrite your code:

    open (EXT, "LDB_EXTID.lst") or die "something"; my @uids = <EXT>; # read in each line as a member of the array close EXT; # here's the key line ! chomp @uids; # remove any trailing newlines from every member of @uids foreach my $uid (@uids) { my $output = `ldbtest.pl -e $uid -t 123`; last if ++$counter > 10; } # stuff you'd do after the loop, if anything

    perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'