FAQ
Hey folks,
This is probably a pretty trivial question but I am in a fog today. I have
a script where users can enter multiple entries as such: perl
myscript.pl -u "myuser1, myuser2, myuser3". I need a way to parse the user
list ("myuser1, myuser2, myuser3") using commas as the delimiter. Any
ideas???

Regards,
DTS

Search Discussions

  • Wagner-David at Oct 10, 2001 at 6:32 pm
    if no spaces are allowed within the name, you could do:
    Sorry but uncertain what the -u does other than tell your script you have input, so I assume you can get value into $ARGV[0]
    my @List = split(/,\s*/, $ARGV[0])
    So @List would have all your entries.

    Wags ;)

    -----Original Message-----
    From: David Simcik
    Sent: Wednesday, October 10, 2001 12:04
    To: Perl Beginners
    Subject: Parsing a Comma-Seperated List


    Hey folks,
    This is probably a pretty trivial question but I am in a fog today. I have
    a script where users can enter multiple entries as such: perl
    myscript.pl -u "myuser1, myuser2, myuser3". I need a way to parse the user
    list ("myuser1, myuser2, myuser3") using commas as the delimiter. Any
    ideas???

    Regards,
    DTS


    --
    To unsubscribe, e-mail: beginners-unsubscribe@perl.org
    For additional commands, e-mail: beginners-help@perl.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedOct 10, '01 at 6:06p
activeOct 10, '01 at 6:32p
posts2
users2
websiteperl.org

2 users in discussion

Wagner-David: 1 post David Simcik: 1 post

People

Translate

site design / logo © 2022 Grokbase