in reply to print statement problem

A bit subtle this one: the first arg to split is actually a regular expression. "." matches any character; so every character is a separator. So the elements in @title are blank.

To solve it, simply backslash it:

split('\.', $file)

Replies are listed 'Best First'.
Re: Re: print statement problem
by cal (Beadle) on Jul 22, 2002 at 22:54 UTC
    Thanks,
    I tried the split syntax change and It works great.
    right on
    Cal
      It should really be written as split /\./, $file though, since split actually uses a regex as the delimiter. Passing a string is misleading and may trip someone who casually reads your code.

      Makeshifts last the longest.