Re: Using Substr and Regular expressions.
- From: "kent.westmoreland@xxxxxxxxx" <kent.westmoreland@xxxxxxxxx>
- Date: 23 Feb 2007 12:51:22 -0800
On Feb 23, 10:21 am, "Dan Mercer" <damer...@xxxxxxxxxxx> wrote:
My guess is that if you have to ask this question, you're not ready
to program in perl yet. A number of solutions are available:
use strict;
use warnings;
my $num;
my $name;
($num,$name) = (split /_/,$ARGV[0])[1,2];
is just one of many possibilities.
Dan Mercer
Dan,
Your blunt response "My guess is that if you have to ask this
question, you're not ready to program in perl yet." is not far from
the truth.
I only recently started to "learn" perl ( 2 days ago). I am modifying
a script that was given to me to preform a specific task. I wanted to
make the script easier to use but I was not having much luck with the
tutorials I found on the web. I figured posting here was a great
place to find information that I required.
I have tried both Manish and your suggestions ( both of which work
fine) with a few modifications.
Some of my main holdbacks on perl where syntactical ( I actually had
something similar to your version using the split function but only
one variable).
Anyway, thanks to everyone for all of your examples and help! Now I
have a lot of things to research.
Kent
.
- Follow-Ups:
- Re: Using Substr and Regular expressions.
- From: Dan Mercer
- Re: Using Substr and Regular expressions.
- References:
- Using Substr and Regular expressions.
- From: kent.westmoreland@xxxxxxxxx
- Re: Using Substr and Regular expressions.
- From: Dan Mercer
- Using Substr and Regular expressions.
- Prev by Date: Re: Using Substr and Regular expressions.
- Next by Date: Re: Help with search and replace
- Previous by thread: Re: Using Substr and Regular expressions.
- Next by thread: Re: Using Substr and Regular expressions.
- Index(es):
Relevant Pages
|