Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > @ARGV not working

Reply
Thread Tools

@ARGV not working

 
 
Ray
Guest
Posts: n/a
 
      10-25-2004
For some reason, @argv doesn't work on my machine, but when I run the
script on a coworker's machine (which has the same NT build as I do it
works).

Example:

When I type at the command line: perl test.pl foo
I don't get any output. No error messages, nothing. When I run the
script on another machine it works as expected. Here's the code
snippet I'm using:


print @INC;
print @ARGV;


The first print statement works as expected, but the @ARGV doesn't.

Any ideas?

Thanks
 
Reply With Quote
 
 
 
 
wana
Guest
Posts: n/a
 
      10-25-2004
Ray wrote:

> For some reason, @argv doesn't work on my machine, but when I run the
> script on a coworker's machine (which has the same NT build as I do it
> works).
>
> Example:
>
> When I type at the command line: perl test.pl foo
> I don't get any output. No error messages, nothing. When I run the
> script on another machine it works as expected. Here's the code
> snippet I'm using:
>
>
> print @INC;
> print @ARGV;
>
>
> The first print statement works as expected, but the @ARGV doesn't.
>
> Any ideas?
>
> Thanks


It worked for me:

perl -e 'print @ARGV' 'it ' 'works'

output: it works

wana
 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      10-25-2004
wana <(E-Mail Removed)> wrote in news:(E-Mail Removed):

> Ray wrote:
>
>> For some reason, @argv doesn't work on my machine, but when I run the


You are positive that you did not misspell @ARGV in your script?

> It worked for me:
>
> perl -e 'print @ARGV' 'it ' 'works'


If you are using cmd.exe, you might want to change that to:

C:\Home> perl -e"print qq{@ARGV}" it works
it works

Sinan
 
Reply With Quote
 
Arndt Jonasson
Guest
Posts: n/a
 
      10-26-2004

http://www.velocityreviews.com/forums/(E-Mail Removed) (Ray) writes:
> For some reason, @argv doesn't work on my machine, but when I run the
> script on a coworker's machine (which has the same NT build as I do it
> works).
>
> Example:
>
> When I type at the command line: perl test.pl foo
> I don't get any output. No error messages, nothing. When I run the
> script on another machine it works as expected. Here's the code
> snippet I'm using:
>
>
> print @INC;
> print @ARGV;
>
>
> The first print statement works as expected, but the @ARGV doesn't.
>
> Any ideas?


I get the bad behaviour on Solaris (Perl 5.005) as well.

I suggest outputting a "\n" as well:

print @INC;
print @ARGV;
print "\n";

I don't know why this should behave differently on two machines of the
same kind, but maybe there are timing considerations (speculating wildly).
(So why does @INC get printed? Maybe because it's much longer than @ARGV.)
 
Reply With Quote
 
Ting Wang
Guest
Posts: n/a
 
      10-26-2004
>I get the bad behaviour on Solaris (Perl 5.005) as well.
I do not get the bad behaviour on Solaris 2.8 (Perl 5.005).
print @ARGV;
works as expected
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect is not working but server.transfer is working gaurav tyagi ASP .Net 14 01-20-2006 04:22 AM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
ASP.NET client-side validation working, but button click not working Alan Silver ASP .Net 1 08-02-2005 03:50 PM
Cookies working on intranet but NOT working on Internet Martin Heuckeroth ASP .Net 5 04-01-2005 01:37 AM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM



Advertisments