CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [digioleg54] How can I use @ARGV: Edit Log



FishMonger
Veteran / Moderator

Aug 24, 2016, 1:56 PM


Views: 4180
Re: [digioleg54] How can I use @ARGV


In Reply To
I know that, 0 element is the program name, the second is file name, that is why I made it ARGV[1]. I need the file name;


WRONG


Code
c:\test>type test.pl 
#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;

print Dumper \@ARGV;


Code
c:\test>perl test.pl file.txt 
$VAR1 = [
'file.txt'
];



(This post was edited by FishMonger on Aug 24, 2016, 1:56 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Aug 24, 2016, 1:56 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives