in reply to a small help in split

Easiest and simplest to understand way to me is to use split like this:
my $a = "index.html"; my ($filename, $extension) = split /\./, $a; print "filename = $filename\n"; print "extension = $extension\n";
You can accept a list of values on the left by surrounding them with parenthesis, like 'my ($filename, $extension) = ...'.

HTH.

Replies are listed 'Best First'.
Re: Re: a small help in split
by hmerrill (Friar) on May 06, 2003 at 13:57 UTC
    BTW, you can see for yourself how split works by reading the excellent documentation included with Perl called 'perldocs'. Do this at a command prompt:
    perldoc -f split
    and more generally, read about perldocs by doing
    perldoc perldoc and perldoc perl
    HTH.
Re: Re: a small help in split
by Anonymous Monk on May 06, 2003 at 14:02 UTC
    THANKS A BUNCH FOR THE HELP , I AM HAVING A SLOW BRAIN DAY TODAY , THANK YOU AGAIN