Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!rbj From: rbj@uunet.UU.NET (Root Boy Jim) Newsgroups: comp.lang.perl Subject: Re: split() Message-ID: <130088@uunet.UU.NET> Date: 23 Apr 91 02:55:34 GMT References: Organization: UUNET Communications Services, Falls Church, VA Lines: 22 In subbarao@phoenix (Kartik Subbarao) writes: ?Why do I have to say this in perl: ? ?@foo = split(/[ ,]+/, join(' ', @ARGV)); ? ?When all I just want to say is: ? ?@foo = split(/[ ,]+/, @ARGV); Split takes anywhere from zero to three arguments. The applicable one here is @array = split(/pat/,$string); You should, however, be able to get away with @foo = split(/[ ,]+/, "@ARGV"); which will have the same effect as the join providing you didn't change one of those variables which I'm too lazy to look up (I lied: it's $"). -- [rbj@uunet 1] stty sane unknown mode: sane