home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!s5!is1.is.morgan.com!is0.is.morgan.com!robt
- From: robt@is.morgan.com (Rob Torop)
- Subject: Re: @ARGV
- In-Reply-To: toro.MTS.ML.COM!scott%beethoven@uunet.uu.net's message of 31 Jul 92 00:39:11 GMT
- Message-ID: <ROBT.92Jul31121248@idt101.is.morgan.com>
- Sender: news@is.morgan.com
- Nntp-Posting-Host: idt101
- Organization: Morgan Stanley & Company
- References: <1992Jul31.003911.12553@uvaarpa.Virginia.EDU>
- Date: Fri, 31 Jul 1992 17:12:48 GMT
- Lines: 44
-
- In article <1992Jul31.003911.12553@uvaarpa.Virginia.EDU> toro.MTS.ML.COM!scott%beethoven@uunet.uu.net (Scott Strool) writes:
-
- Path: is1.is.morgan.com!s5!uunet!dtix!darwin.sura.net!uvaarpa!mmdf
- From: toro.MTS.ML.COM!scott%beethoven@uunet.uu.net (Scott Strool)
- Newsgroups: comp.lang.perl
- Date: 31 Jul 92 00:39:11 GMT
- Sender: mmdf@uvaarpa.Virginia.EDU (Mail System)
- Reply-To: Scott Strool <toro.MTS.ML.COM!scott%beethoven@uunet.uu.net>
- Organization: The Internet
- Lines: 13
-
- How can I get the individual characters from the command line variable.
- for instance if the user entered 'xbr'. I want to know that the first char
- is 'x', second is 'b' and third is 'r'.
-
- thanks,
- srs
- Scott Strool
- Consultant
- Merrill Lynch & Co Inc.
- Tel: (212) 449-1456
- Fax: (212) 449-1465
- scott@ml.com
- uunet!toro!scott
-
- This should do the trick:
-
- @chars = split(//, $ARGV[0]);
-
- The individual characters will then be $chars[0], etc...
-
- -- Rob Torop
-
- +---------------------------------------------------------------------+
- | The views expressed here are neither mine nor those of my employer. |
- +---------------------------------------------------------------------+
-
-
- --
- -- Rob Torop
-
- +---------------------------------------------------------------------+
- | The views expressed here are neither mine nor those of my employer. |
- +---------------------------------------------------------------------+
-