in reply to how to chop last character from a string

well, if chop removed a \n then the last character of that string was \n. Why can't you just chop again? If that doesn't appeal to you you could do something like
$ARGV[0] =~ s/\*.*$//;
That should do it too.

Replies are listed 'Best First'.
Re^2: how to chop last character from a string
by suaveant (Parson) on Jan 03, 2006 at 21:28 UTC
    That will do a lot more than remove a trailing *, if there is ever anything else after the *...

                    - Ant
                    - Some of my best work - (1 2 3)

Re^2: how to chop last character from a string
by bioMan (Beadle) on Jan 04, 2006 at 15:26 UTC

    Rather than chopping twice a safer way would be to chomp first then chop.

    But, I like the regex solutions better than chopping

    Mike