jeadge has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: web spider
by monkey_boy (Priest) on Mar 23, 2006 at 13:55 UTC
    Use a regex, see the docs
    for my $email (@addresses) { if ($email =~ m/^(.*?)ulster.ac.uk/) { print $1 , "\n"; }; };



    This is not a Signature...
Re: web spider
by socketdave (Curate) on Mar 23, 2006 at 14:04 UTC
    When posting this type of question, you'll generally get a better response if you take a shot and post the code that's not working for you. That said, you might want something like this:
    map s/\@ulster\.ac\.uk//, @your_array;
    or
    map s/\@ulster\.ac\.uk//g, @your_array;
    if there is a possibility that an array element will hold more than one email address.

    Take some time and look up 'map' and s///. There is MTOWTDI, and there are more basic solutions to this problem.
Re: web spider
by Anonymous Monk on Mar 24, 2006 at 05:22 UTC
    Of course, regexes aren't the only way to go:
    #!perl -l print substr($_, 0, index($_, '@')) for @emails;