Perl Question

A

amerar

Hi All,

I have an array that I form in Unix, KSH:

set -A fnames "daily_prices.fdp previous_prices.zprs eps_reports.ex3
Z_IND.DAT X_INDUSTRY.SEQ"

Then, I try and pass that to a Perl script: ./a.pl $fnames

I receive it in the Perl script: $x = $ARGV[0];

However, only the first element of the array is prevent......

What am I doing wrong?

Thanks!
 
B

Ben Morrow

Quoth "[email protected] said:
I have an array that I form in Unix, KSH:

set -A fnames "daily_prices.fdp previous_prices.zprs eps_reports.ex3
Z_IND.DAT X_INDUSTRY.SEQ"

Then, I try and pass that to a Perl script: ./a.pl $fnames

I receive it in the Perl script: $x = $ARGV[0];

However, only the first element of the array is prevent......

Presumably (I don't know ksh) since you didn't quote $fnames, it got
passed as several arguments instead of one, so the rest are in
@ARGV[1..N].

Ben
 
M

Martijn Lievaart

Hi All,

I have an array that I form in Unix, KSH:

set -A fnames "daily_prices.fdp previous_prices.zprs eps_reports.ex3
Z_IND.DAT X_INDUSTRY.SEQ"

Then, I try and pass that to a Perl script: ./a.pl $fnames

I receive it in the Perl script: $x = $ARGV[0];

However, only the first element of the array is prevent......

What am I doing wrong?

Not a Perl question at all. Read up on argument quoting and try

../a.pl "$fnames"

HTH,
M4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top