Re: [Perl-unix-users] Problem that I am having with split command

2004-04-14 Thread Jon Shorie
Thanks to everyone for all the help. It is now working. I am going to use the following code: ($a,$b,$c,$d,$e,$f) = split /[\-\/\.]/, $string; On Wednesday 14 April 2004 14:30, Stacy Doss wrote: > You need to be aware that split works on a regexp therefore the /./ is > matching any character. I

Re: [Perl-unix-users] Problem that I am having with split command

2004-04-14 Thread Andy_Bach
'.' is an RE metachar, so, at the least, you want to escape it: split(/\./ If you're fairly confident about the format: my ($a, $b, $c, $d, $e, $f) = split(/[^\d]/, $projectnumber); that is, split on non-digits or specify the actual chars: my ($a, $b, $c, $d, $e, $f) = split(/[-\/.]/, $projectnum

Re: [Perl-unix-users] Problem that I am having with split command

2004-04-14 Thread John Kulas
Jon, the dot (or period) is a reserved character, remember? You need to escape it if you want to use that character. Try ($c,$d,$e,$f) = split(/\./,$g); - John Kulas ___ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.Ac

RE: [Perl-unix-users] Problem that I am having with split command

2004-04-14 Thread Stacy Doss
You need to be aware that split works on a regexp therefore the /./ is matching any character. I'm not sure what you vars $projectnumber and $pa are but I'll assum you want something like this $string = '500/00-7.1.19.3'; # This will split the whole string at once retaining only the digits for

[Perl-unix-users] Problem that I am having with split command

2004-04-14 Thread Jon Shorie
If I have the following kind of data 500/00-7.1.19.3 I want to split it into separate variables as such $a = "500" $b = "00" $c = "7" $d = "1" $e = "19" $f = "3" Here is what I have so far ($a,$g) = split("/",$projectnumber); ($b,$g) = split(/-/,$pa); ($c,$d,$e,$f) = split(/./,$g); print "$a xx