S
Slow Learner
Hey gurus,
If, say, I have a URL (or any "path" type string come to think of it), how
can I truncate it if it's greater than a certain length? Note: I don't want
to use it as a path, I just want to truncate it from display purposes. For
example:
http://www.mysite.com/beta/content/english/misc/publications/papers/index.html
..... and I want to restrict it to no more than 50 characters, but I want the
result to look something like this:
..../english/misc/publications/papers/index.html
In other words, I want the left-most part of a path string replaced with
".../" for those bits of the path that make it go over 50 characters.
How can I do this in Perl?
Thanks
If, say, I have a URL (or any "path" type string come to think of it), how
can I truncate it if it's greater than a certain length? Note: I don't want
to use it as a path, I just want to truncate it from display purposes. For
example:
http://www.mysite.com/beta/content/english/misc/publications/papers/index.html
..... and I want to restrict it to no more than 50 characters, but I want the
result to look something like this:
..../english/misc/publications/papers/index.html
In other words, I want the left-most part of a path string replaced with
".../" for those bits of the path that make it go over 50 characters.
How can I do this in Perl?
Thanks