Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > need help in perl arrays (New to perl but know TCL well)

Reply
Thread Tools

need help in perl arrays (New to perl but know TCL well)

 
 
Anil A Kumar
Guest
Posts: n/a
 
      08-03-2011
I saw some where:

my @options = ("value1!", "value2:s", "value3:s@", "value4:s%");

I would like to know what this !, @, % characters represent here?

-Anil
 
Reply With Quote
 
 
 
 
Willem
Guest
Posts: n/a
 
      08-03-2011
Anil A Kumar wrote:
) I saw some where:
)
) my @options = ("value1!", "value2:s", "value3:s@", "value4:s%");
)
) I would like to know what this !, @, % characters represent here?

They represent nothing special here. I assume that later they are
being used by some function that assigns special meaning to them.

In this case, they look very familiar to Getopt::Long.

Look at: perldoc Getopt::Long


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      08-03-2011
Anil A Kumar <(E-Mail Removed)> wrote:
>I saw some where:
>
>my @options = ("value1!", "value2:s", "value3:s@", "value4:s%");
>
>I would like to know what this !, @, % characters represent here?


The first @ is a sigil to indicate that the variable options is an
array.
The others are just ordinary characters in a text.
However if e.g. you had "value3:@s" then the @ would indicate content of
the array variable s because the string is in double quotes. Therefore
it would have been better style to use single instead of double quotes,
because then you would not have to wonder, if the author meant the
literal s@ or maybe the variable @s.

jue

jue
 
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
How to build a loadable tcl dll with visual studio (microsoft C compiler)?[crosspost in comp.lang.tcl and comp.lang.c++] Michael Reichenbach C++ 5 02-08-2010 02:38 PM
Multidimensional arrays and arrays of arrays Philipp Java 21 01-20-2009 08:33 AM
Inline::Tcl vs. Inline::Tcl Mumia W. Perl Misc 0 08-23-2006 04:09 PM
ISAKMP NAT problem (I know it can be done but don't know how) Rogier Mulder Cisco 1 01-13-2005 08:48 PM
I know, I know, I don't know Andries Perl Misc 3 04-23-2004 02:17 AM



Advertisments