Perl 6

Moderators: Jonathan
Number of threads: 11
Number of posts: 19

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
External variable Posted by dumitrescuo on 1 May 2009 at 2:31 AM
Hello ,

I want to know how to use a external var like

#perl script.pl var1 var2

and how to use/define var1 and var2 in script.pl

like $1 $2 in msdos

Have a nice day
Report
Re: External variable Posted by KeyCode on 6 May 2009 at 6:07 AM
Do you mean how to work with command line arguments which were used when calling your perl script?
If so...

- Input Parameters:
- This example shows how to call "PERL Console Application" with input parameters and read them from the code.
- Create C:\Temp\Test.pl – Start MSDOS – cd C:\Temp – perl Test.pl arg1 arg2 arg3

Test.pl
for($i=0;$i<=$#ARGV;$i++) { print("$ARGV[$i]\n"); }

Report
Re: External variable Posted by Jonathan on 7 May 2009 at 8:44 AM
They're just in the @ARGV array, so:

print $ARGV[0];


Will print the first one for example.

Jonathan
###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");



 

Recent Jobs